Part Number Hot Search : 
PM150C24 OPB763T X1001 R2500 RR09331F RGE1100 LRTBGFTG 6GBU06
Product Description
Full Text Search
 

To Download 68HC08BD24 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  mc68HC08BD24/d rev. 1.0 mc68HC08BD24 hcmos microcontroller unit technical data f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola list of sections 3 technical data ?mc68HC08BD24 list of sections section 1. general description . . . . . . . . . . . . . . . . . . . .21 section 2. memory map . . . . . . . . . . . . . . . . . . . . . . . . . .31 section 3. random-access memory (ram) . . . . . . . . . .49 section 4. read-only memory (rom) . . . . . . . . . . . . . . .51 section 5. configuration register (config) . . . . . . . . .53 section 6. central processor unit (cpu) . . . . . . . . . . . .57 section 7. system integration module (sim) . . . . . . . . .77 section 8. oscillator (osc) . . . . . . . . . . . . . . . . . . . . . .101 section 9. monitor rom (mon) . . . . . . . . . . . . . . . . . . .105 section 10. timer interface module (tim) . . . . . . . . . . .115 section 11. pulse width modulator (pwm) . . . . . . . . . .137 section 12. analog-to-digital converter (adc) . . . . . .143 section 13. ddc12ab interface . . . . . . . . . . . . . . . . . . .153 section 14. sync processor . . . . . . . . . . . . . . . . . . . . . .169 section 15. input/output (i/o) ports . . . . . . . . . . . . . . .189 section 16. external interrupt (irq) . . . . . . . . . . . . . . .211 section 17. computer operating properly (cop) . . . .217 section 18. break module (brk) . . . . . . . . . . . . . . . . . .223 section 19. electrical specifications . . . . . . . . . . . . . . .231 section 20. mechanical specifications . . . . . . . . . . . . .239 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of sections technical data mc68HC08BD24 ? rev. 1.0 4 list of sections motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola table of contents 5 technical data ?mc68HC08BD24 table of contents section 1. general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.4 mcu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.5 pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.6 pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 section 2. memory map 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.3 unimplemented memory locations . . . . . . . . . . . . . . . . . . . . . 31 2.4 reserved memory locations . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.5 input/output (i/o) section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 section 3. random-access memory (ram) 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 3.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 section 4. read-only memory (rom) 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents technical data mc68HC08BD24 ? rev. 1.0 6 table of contents motorola section 5. configuration register (config) 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.3 configuration register 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.4 configuration register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 section 6. central processor unit (cpu) 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.4 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.4.1 accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.4.2 index register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.4.3 stack pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.4.4 program counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.4.5 condition code register . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.5 arithmetic/logic unit (alu) . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.6 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.6.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.6.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.7 cpu during break interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.8 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.9 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 section 7. system integration module (sim) 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 7.3 sim bus clock control and generation . . . . . . . . . . . . . . . . . . 81 7.3.1 bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7.3.2 clock start-up from por . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68HC08BD24 ? rev. 1.0 technical data motorola table of contents 7 7.3.3 clocks in stop mode and wait mode . . . . . . . . . . . . . . . . . . 81 7.4 reset and system initialization. . . . . . . . . . . . . . . . . . . . . . . . . 82 7.4.1 external pin reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7.4.2 active resets from internal sources . . . . . . . . . . . . . . . . . . 83 7.4.2.1 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7.4.2.2 computer operating properly (cop) reset . . . . . . . . . . 85 7.4.2.3 illegal opcode reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.4.2.4 illegal address reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.5 sim counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.5.1 sim counter during power-on reset . . . . . . . . . . . . . . . . . 86 7.5.2 sim counter during stop mode recovery . . . . . . . . . . . . . . 87 7.5.3 sim counter and reset states. . . . . . . . . . . . . . . . . . . . . . . 87 7.6 exception control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 7.6.1 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 7.6.1.1 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 7.6.1.2 swi instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 7.6.2 interrupt status registers. . . . . . . . . . . . . . . . . . . . . . . . . . . 91 7.6.2.1 interrupt status register 1 . . . . . . . . . . . . . . . . . . . . . . . . 93 7.6.2.2 interrupt status register 2 . . . . . . . . . . . . . . . . . . . . . . . . 93 7.6.3 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 7.6.4 break interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 7.6.5 status flag protection in break mode . . . . . . . . . . . . . . . . . 94 7.7 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 7.7.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 7.7.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 7.8 sim registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.8.1 sim break status register (sbsr) . . . . . . . . . . . . . . . . . . . 98 7.8.2 sim reset status register (srsr) . . . . . . . . . . . . . . . . . . . 99 7.8.3 sim break flag control register (sbfcr) . . . . . . . . . . . . 100 section 8. oscillator (osc) 8.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 8.3 oscillator external connections . . . . . . . . . . . . . . . . . . . . . . . 102 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents technical data mc68HC08BD24 ? rev. 1.0 8 table of contents motorola 8.4 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 8.4.1 crystal amplifier input pin (osc1). . . . . . . . . . . . . . . . . . . 103 8.4.2 crystal amplifier output pin (osc2) . . . . . . . . . . . . . . . . . 103 8.4.3 oscillator enable signal (simoscen). . . . . . . . . . . . . . . . 103 8.4.4 external clock source (oscxclk) . . . . . . . . . . . . . . . . . . 103 8.4.5 oscillator out (oscout). . . . . . . . . . . . . . . . . . . . . . . . . . 103 8.5 low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 8.5.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 8.5.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 8.6 oscillator during break mode. . . . . . . . . . . . . . . . . . . . . . . . . 104 section 9. monitor rom (mon) 9.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 9.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 9.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 9.4.1 entering monitor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 9.4.2 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 9.4.3 echoing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 9.4.4 break signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 9.4.5 commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 9.4.6 baud rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 section 10. timer interface module (tim) 10.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 10.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 10.4 pin name conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 10.5 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 10.5.1 tim counter prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 10.5.2 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 10.5.3 output compare. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68HC08BD24 ? rev. 1.0 technical data motorola table of contents 9 10.5.3.1 unbuffered output compare . . . . . . . . . . . . . . . . . . . . . 120 10.5.3.2 buffered output compare . . . . . . . . . . . . . . . . . . . . . . . 121 10.5.4 pulse width modulation (pwm) . . . . . . . . . . . . . . . . . . . . . 121 10.5.4.1 unbuffered pwm signal generation . . . . . . . . . . . . . . . 122 10.5.4.2 buffered pwm signal generation . . . . . . . . . . . . . . . . . 123 10.5.4.3 pwm initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 10.6 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 10.7 wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 10.8 tim during break interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . 126 10.9 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 10.10 i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 10.10.1 tim status and control register (tsc) . . . . . . . . . . . . . . . 127 10.10.2 tim counter registers (tcnth:tcntl) . . . . . . . . . . . . . . 129 10.10.3 tim counter modulo registers (tmodh:tmodl) . . . . . . 130 10.10.4 tim channel status and control registers (tsc0:tsc1) . 131 10.10.5 tim channel registers (tch0h/l:tch1h/l) . . . . . . . . . . 135 section 11. pulse width modulator (pwm) 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 11.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 11.4 pwm registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 11.4.1 pwm data registers 0 to 15 (0pwm?5pwm). . . . . . . . . 140 11.4.2 pwm control registers 1 and 2 (pwmcr1:pwmcr2) . . 141 section 12. analog-to-digital converter (adc) 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 12.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 12.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 12.4.1 adc port i/o pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents technical data mc68HC08BD24 ? rev. 1.0 10 table of contents motorola 12.4.2 voltage conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 12.4.3 conversion time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 12.4.4 continuous conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 12.4.5 accuracy and precision . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.5 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.6 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.6.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.6.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.7 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.7.1 adc voltage in (adcvin) . . . . . . . . . . . . . . . . . . . . . . . . . 148 12.8 i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 12.8.1 adc status and control register. . . . . . . . . . . . . . . . . . . . 148 12.8.2 adc data register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 12.8.3 adc input clock register . . . . . . . . . . . . . . . . . . . . . . . . . 151 section 13. ddc12ab interface 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 13.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 13.4 i/o pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 13.5 ddc protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 13.6 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 13.6.1 ddc address register (dadr) . . . . . . . . . . . . . . . . . . . . . 156 13.6.2 ddc2 address register (d2adr) . . . . . . . . . . . . . . . . . . . 157 13.6.3 ddc control register (dcr) . . . . . . . . . . . . . . . . . . . . . . . 158 13.6.4 ddc master control register (dmcr) . . . . . . . . . . . . . . . 159 13.6.5 ddc status register (dsr) . . . . . . . . . . . . . . . . . . . . . . . . 162 13.6.6 ddc data transmit register (ddtr) . . . . . . . . . . . . . . . . 164 13.6.7 ddc data receive register (ddrr). . . . . . . . . . . . . . . . . 165 13.7 programming considerations . . . . . . . . . . . . . . . . . . . . . . . . . 166 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68HC08BD24 ? rev. 1.0 technical data motorola table of contents 11 section 14. sync processor 14.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 14.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 14.4 i/o pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 14.5 functional blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 14.5.1 polarity detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 14.5.1.1 hsync polarity detection . . . . . . . . . . . . . . . . . . . . . . . . 174 14.5.1.2 vsync polarity detection . . . . . . . . . . . . . . . . . . . . . . . . 174 14.5.1.3 composite sync polarity detection . . . . . . . . . . . . . . . . 174 14.5.2 sync signal counters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 14.5.3 polarity controlled hsynco and vsynco outputs. . . . . 175 14.5.4 clamp pulse output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 14.5.5 low vertical frequency detect . . . . . . . . . . . . . . . . . . . . . 177 14.6 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 14.6.1 sync processor control & status register (spcsr). . . . . 177 14.6.2 sync processor input/output control register (spiocr) . 179 14.6.3 vertical frequency registers (vfrs). . . . . . . . . . . . . . . . . 181 14.6.4 hsync frequency registers (hfrs). . . . . . . . . . . . . . . . . . 183 14.6.5 sync processor control register 1 (spcr1). . . . . . . . . . . 185 14.6.6 h&v sync output control register (hvocr) . . . . . . . . . . 186 14.7 system operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 section 15. input/output (i/o) ports 15.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 15.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 15.3.1 port a data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 15.3.2 data direction register a . . . . . . . . . . . . . . . . . . . . . . . . . 194 15.3.3 port a options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 15.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 15.4.1 port b data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents technical data mc68HC08BD24 ? rev. 1.0 12 table of contents motorola 15.4.2 data direction register b . . . . . . . . . . . . . . . . . . . . . . . . . 197 15.4.3 port b options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 15.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 15.5.1 port c data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 15.5.2 data direction register c . . . . . . . . . . . . . . . . . . . . . . . . . 200 15.5.3 port c options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 15.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 15.6.1 port d data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 15.6.2 data direction register d. . . . . . . . . . . . . . . . . . . . . . . . . . 203 15.6.3 port d options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 15.7 port e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 15.7.1 port e data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 15.7.2 data direction register e. . . . . . . . . . . . . . . . . . . . . . . . . . 207 15.7.3 port e options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 section 16. external interrupt (irq) 16.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 16.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 16.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 16.5 irq pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 16.6 irq module during break interrupts . . . . . . . . . . . . . . . . . . . 215 16.7 irq status and control register . . . . . . . . . . . . . . . . . . . . . . 215 section 17. computer operating properly (cop) 17.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 17.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 17.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 17.4 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 17.4.1 oscxclk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 17.4.2 stop instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68HC08BD24 ? rev. 1.0 technical data motorola table of contents 13 17.4.3 copctl write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 17.4.4 power-on reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 17.4.5 internal reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 17.4.6 reset vector fetch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 17.4.7 copd (cop disable). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 17.4.8 coprs (cop rate select) . . . . . . . . . . . . . . . . . . . . . . . . 220 17.5 cop control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 17.6 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 17.7 monitor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 17.8 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 17.8.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 17.8.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 17.9 cop module during break mode . . . . . . . . . . . . . . . . . . . . . . 222 section 18. break module (brk) 18.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 18.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 18.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 18.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 18.4.1 flag protection during break interrupts . . . . . . . . . . . . . . . 226 18.4.2 cpu during break interrupts . . . . . . . . . . . . . . . . . . . . . . . 226 18.4.3 tim during break interrupts . . . . . . . . . . . . . . . . . . . . . . . . 226 18.4.4 cop during break interrupts . . . . . . . . . . . . . . . . . . . . . . . 226 18.5 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 18.5.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 18.5.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 18.6 break module registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 18.6.1 break status and control register. . . . . . . . . . . . . . . . . . . 227 18.6.2 break address registers . . . . . . . . . . . . . . . . . . . . . . . . . . 228 18.6.3 sim break status register . . . . . . . . . . . . . . . . . . . . . . . . . 228 18.6.4 sim break flag control register . . . . . . . . . . . . . . . . . . . . 230 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents technical data mc68HC08BD24 ? rev. 1.0 14 table of contents motorola section 19. electrical specifications 19.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 19.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 19.3 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . 232 19.4 functional operating range. . . . . . . . . . . . . . . . . . . . . . . . . . 233 19.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 19.6 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 234 19.7 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 19.8 oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 19.9 adc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 19.10 timer interface module characteristics . . . . . . . . . . . . . . . . . 237 19.11 sync processor timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 19.12 ddc12ab timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 19.12.1 ddc12ab interface input signal timing . . . . . . . . . . . . . . 238 19.12.2 ddc12ab interface output signal timing . . . . . . . . . . . . . 238 section 20. mechanical specifications 20.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 20.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 20.3 44-pin plastic quad flat pack (qfp) . . . . . . . . . . . . . . . . . . . 240 20.4 42-pin shrink dual in-line package (sdip) . . . . . . . . . . . . . . 241 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola list of figures 15 technical data ?mc68HC08BD24 list of figures figure title page 1-1 mcu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1-2 44-pin qfp pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1-3 42-pin sdip pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . 26 2-1 memory map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2-2 control, status, and data registers . . . . . . . . . . . . . . . . . . . . . 35 5-1 configuration register 0 (config0) . . . . . . . . . . . . . . . . . . . . 54 5-2 configuration register 1 (config1) . . . . . . . . . . . . . . . . . . . . 55 6-1 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6-2 accumulator (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6-3 index register (h:x) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6-4 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6-5 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6-6 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . . . . 62 7-1 sim block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7-2 osc clock signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7-3 external reset timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 7-4 internal reset timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 7-5 sources of internal reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7-6 por recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 7-7 interrupt entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 7-8 interrupt recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 7-9 interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 7-10 interrupt recognition example . . . . . . . . . . . . . . . . . . . . . . . . . 90 7-11 interrupt status register 1 (int1). . . . . . . . . . . . . . . . . . . . . . . 93 7-12 interrupt status register 2 (int2). . . . . . . . . . . . . . . . . . . . . . . 93 7-13 wait mode entry timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of figures technical data mc68HC08BD24 ? rev. 1.0 16 list of figures motorola figure title page 7-14 wait recovery from interrupt or break . . . . . . . . . . . . . . . . . . . 96 7-15 wait recovery from internal reset. . . . . . . . . . . . . . . . . . . . . . 96 7-16 stop mode entry timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 7-17 stop mode recovery from interrupt or break . . . . . . . . . . . . . . 97 7-18 sim break status register (sbsr) . . . . . . . . . . . . . . . . . . . . . 98 7-19 sim reset status register (srsr) . . . . . . . . . . . . . . . . . . . . . 99 7-20 sim break flag control register (sbfcr) . . . . . . . . . . . . . . 100 8-1 oscillator external connections . . . . . . . . . . . . . . . . . . . . . . . 102 9-1 monitor mode circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 9-2 monitor data format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 9-3 sample monitor waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . 109 9-4 read transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 9-5 break transaction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 10-1 tim block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 10-2 pwm period and pulse width . . . . . . . . . . . . . . . . . . . . . . . . 122 10-3 tim status and control register (tsc) . . . . . . . . . . . . . . . . . 127 10-4 tim counter registers (tcnth:tcntl) . . . . . . . . . . . . . . . . 130 10-5 tim counter modulo registers (tmodh:tmodl). . . . . . . . . 131 10-6 tim channel status and control registers (tsc0:tsc1) . . . 132 10-7 chxmax latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 10-8 tim channel registers (tch0h/l:tch1h/l). . . . . . . . . . . . . 136 11-1 pwm data registers 0 to 15 (0pwm?5pwm) . . . . . . . . . . . 140 11-2 pwm control register 1 and 2 (pwmcr1:pwmcr2). . . . . . 141 11-3 8-bit pwm output waveforms . . . . . . . . . . . . . . . . . . . . . . . . 142 12-1 adc block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 12-2 adc status and control register (adscr) . . . . . . . . . . . . . . 148 12-3 adc data register (adr) . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 12-4 adc input clock register (adiclk) . . . . . . . . . . . . . . . . . . . 151 13-1 ddc address register (dadr) . . . . . . . . . . . . . . . . . . . . . . . 156 13-2 ddc2 address register (d2adr) . . . . . . . . . . . . . . . . . . . . . 157 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of figures mc68HC08BD24 ? rev. 1.0 technical data motorola list of figures 17 figure title page 13-3 ddc control register (dcr) . . . . . . . . . . . . . . . . . . . . . . . . . 158 13-4 ddc master control register (dmcr). . . . . . . . . . . . . . . . . . 159 13-5 ddc status register (dsr) . . . . . . . . . . . . . . . . . . . . . . . . . . 162 13-6 ddc data transmit register (ddtr). . . . . . . . . . . . . . . . . . . 164 13-7 ddc data receive register (ddrr) . . . . . . . . . . . . . . . . . . . 165 13-8 data transfer sequences for master/slave transmit/receive modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 14-1 sync processor block diagram . . . . . . . . . . . . . . . . . . . . . . . 173 14-2 clamp pulse output timing . . . . . . . . . . . . . . . . . . . . . . . . . . 176 14-3 sync processor control & status register (spcsr) . . . . . . . 177 14-4 sync processor input/output control register (spiocr) . . . 179 14-5 vertical frequency high register . . . . . . . . . . . . . . . . . . . . . . 181 14-6 vertical frequency low register . . . . . . . . . . . . . . . . . . . . . . 181 14-7 hsync frequency high register . . . . . . . . . . . . . . . . . . . . . . . 183 14-8 hsync frequency low register . . . . . . . . . . . . . . . . . . . . . . . 183 14-9 sync processor control register 1 (spcr1) . . . . . . . . . . . . . 185 14-10 h&v sync output control register (hvocr) . . . . . . . . . . . . 186 15-1 port a data register (pta) . . . . . . . . . . . . . . . . . . . . . . . . . . 193 15-2 data direction register a (ddra) . . . . . . . . . . . . . . . . . . . . . 194 15-3 port a i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 15-4 pwm control register 1 (pwmcr1) . . . . . . . . . . . . . . . . . . . 195 15-5 port b data register (ptb) . . . . . . . . . . . . . . . . . . . . . . . . . . 196 15-6 data direction register b (ddrb) . . . . . . . . . . . . . . . . . . . . . 197 15-7 port b i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 15-8 pwm control register 1 (pwmcr1) . . . . . . . . . . . . . . . . . . . 198 15-9 port c data register (ptc) . . . . . . . . . . . . . . . . . . . . . . . . . . 199 15-10 data direction register c (ddrc) . . . . . . . . . . . . . . . . . . . . . 200 15-11 port c i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 15-12 port d data register (ptd) . . . . . . . . . . . . . . . . . . . . . . . . . . 202 15-13 data direction register d (ddrd) . . . . . . . . . . . . . . . . . . . . . 203 15-14 port d i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 15-15 port d configuration register (pdcr) . . . . . . . . . . . . . . . . . . 205 15-16 port e data register (pte) . . . . . . . . . . . . . . . . . . . . . . . . . . 206 15-17 data direction register e (ddre) . . . . . . . . . . . . . . . . . . . . . 207 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of figures technical data mc68HC08BD24 ? rev. 1.0 18 list of figures motorola figure title page 15-18 port e i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 15-19 configuration register 0 (config0) . . . . . . . . . . . . . . . . . . . 209 16-1 irq module block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 213 16-2 irq status and control register (intscr) . . . . . . . . . . . . . . 216 17-1 cop block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 17-2 configuration register 1 (config1) . . . . . . . . . . . . . . . . . . . 220 17-3 cop control register (copctl) . . . . . . . . . . . . . . . . . . . . . . 221 18-1 break module block diagram . . . . . . . . . . . . . . . . . . . . . . . . . 225 18-2 break status and control register (brkscr). . . . . . . . . . . . 227 18-3 break address register high (brkh) . . . . . . . . . . . . . . . . . . 228 18-4 break address register low (brkl) . . . . . . . . . . . . . . . . . . . 228 18-5 sim break status register (sbsr) . . . . . . . . . . . . . . . . . . . . 229 18-6 sim break flag control register (sbfcr) . . . . . . . . . . . . . . 230 19-1 adc input voltage vs. step readings . . . . . . . . . . . . . . . . . . 237 20-1 44-pin qfp (case 824e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 20-2 42-pin sdip (case 858) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola list of tables 19 technical data ?mc68HC08BD24 list of tables table title page 1-1 pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2-1 vector addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 6-1 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 6-2 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 7-1 sim i/o register summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 7-2 signal name conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 7-3 pin bit set timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7-4 interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 7-5 sim registers summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 9-1 mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 9-2 mode differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 9-3 read (read memory) command . . . . . . . . . . . . . . . . . . . . . 111 9-4 write (write memory) command. . . . . . . . . . . . . . . . . . . . . 112 9-5 iread (indexed read) command . . . . . . . . . . . . . . . . . . . . . 112 9-6 iwrite (indexed write) command . . . . . . . . . . . . . . . . . . . . 113 9-7 readsp (read stack pointer) command . . . . . . . . . . . . . . . 113 9-8 run (run user program) command . . . . . . . . . . . . . . . . . . . 114 9-9 monitor baud rate selection . . . . . . . . . . . . . . . . . . . . . . . . . 114 10-1 pin name conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 10-2 tim i/o register summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 10-3 prescaler selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 10-4 mode, edge, and level selection . . . . . . . . . . . . . . . . . . . . . . 134 11-1 pwm i/o register summary . . . . . . . . . . . . . . . . . . . . . . . . . 138 11-2 pwm channels and port i/o pins. . . . . . . . . . . . . . . . . . . . . . 141 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of tables technical data mc68HC08BD24 ? rev. 1.0 20 list of tables motorola table title page 12-1 adc register summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 12-2 mux channel select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 12-3 adc clock divide ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 13-1 pin name conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 13-2 ddc i/o register summary . . . . . . . . . . . . . . . . . . . . . . . . . . 155 13-3 baud rate select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 14-1 pin name conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 14-2 sync processor i/o register summary . . . . . . . . . . . . . . . . . 172 14-3 sync output control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 14-4 sync output polarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 14-5 atpol, vinvo, and hinvo setting. . . . . . . . . . . . . . . . . . . . 179 14-6 sample vertical frame frequencies . . . . . . . . . . . . . . . . . . . 182 14-7 clamp pulse width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 14-8 hsync polarity detection pulse width . . . . . . . . . . . . . . . . . 185 14-9 atpol, vinvo, and hinvo setting. . . . . . . . . . . . . . . . . . . . 186 14-10 free-running hsync and vsync options . . . . . . . . . . . . . 187 15-1 i/o port register summary. . . . . . . . . . . . . . . . . . . . . . . . . . . 190 15-2 port control register bits summary. . . . . . . . . . . . . . . . . . . . 192 15-3 port a pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 15-4 port b pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 15-5 port c pin functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 15-6 port d pin functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 15-7 port e pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 16-1 irq i/o register summary. . . . . . . . . . . . . . . . . . . . . . . . . . . 213 18-1 break module i/o register summary . . . . . . . . . . . . . . . . . . . 225 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola general description 21 technical data ? mc68HC08BD24 section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.4 mcu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.5 pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.6 pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.2 introduction the mc68HC08BD24 is a member of the low-cost, high-performance m68hc08 family of 8-bit microcontroller units (mcus). the m68hc08 family is based on the customer-specified integrated circuit (csic) design strategy. all mcus in the family use the enhanced m68hc08 central processor unit (cpu08) and are available with a variety of modules, memory sizes and types, and package types. with special modules such as the sync processor, analog-to-digital converter, pulse modulator module, and ddc12ab interface, the mc68HC08BD24 is designed specifically for use in digital monitor systems. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description technical data mc68HC08BD24 ? rev. 1.0 22 general description motorola 1.3 features features of the mc68HC08BD24 mcu include the following: high-performance m68hc08 architecture fully upward-compatible object code with m6805, m146805, and m68hc05 families low-power design; fully static with stop and wait modes 5v operating voltage 6mhz internal bus frequency, with 24mhz external crystal 24,576 + 512 bytes of on-chip read-only memory (rom) 512 bytes of on-chip random access memory (ram) sync signal processor with the following features: horizontal and vertical frequency counters low vertical frequency indicator (40.7hz) polarity controlled hsync and vsync outputs from separate sync or composite sync inputs internal generated free-running hsync and vsync pulses clamp pulse output to the external pre-amp chip 6-channel, 8-bit analog-to-digital converter (adc) 16-channel, 8-bit pulse width modulator (pwm) ddc12ab 1 module with the following: ddc1 hardware multi-master iic 2 hardware for ddc2ab; with dual address 16-bit, 2-channel timer interface module (tim) with selectable input capture, output compare, and pwm capability on one channel 1. ddc is a vesa bus standard. 2. iic is a proprietary philips interface bus. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description mcu block diagram mc68HC08BD24 ? rev. 1.0 technical data motorola general description 23 32 general purpose input/output (i/o) pins, including: 32 shared-function i/o pins 4 open-drain i/o pins system protection features: optional computer operating properly (cop) reset illegal opcode detection with reset illegal address detection with reset rom security 1 master reset pin with internal pull-up and power-on reset irq with programmable pull-up and schmitt-trigger input 42-pin sdip and 44-pin qfp packages features of the cpu08 include the following: enhanced hc05 programming model extensive loop control functions 16 addressing modes (eight more than the hc05) 16-bit index register and stack pointer memory-to-memory data transfers fast 8 8 multiply instruction fast 16/8 divide instruction binary-coded decimal (bcd) instructions optimization for controller applications third party c language support 1.4 mcu block diagram figure 1-1 shows the structure of the mc68HC08BD24. 1. no security feature is absolutely secure. however, motorola? strategy is to make reading or copying the rom difficult for unauthorized users. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description technical data mc68HC08BD24 ? rev. 1.0 24 general description motorola figure 1-1. mcu block diagram system integration module monitor module pulse width modulator module arithmetic/logic unit (alu) cpu registers m68hc08 cpu control and status registers ?80 bytes user rom ?24,576 + 512 bytes user ram ?512 bytes monitor rom ?470 bytes user rom vectors ?26 bytes external irq module ddrd portd ddre porte internal bus osc1 osc2 rst irq 8-bit analog-to-digital converter module computer operating properly module ptd6 ? ptd5 ? ptd4/clamp ptd3/ddcscl ? ptd2/ddcsda ? ptd1 ptd0 pte1/hsynco pte0/sog/tch0 2-channel timer interface module ? ddc12ab interface module power-on reset module sync processor module ? pin is +5v open-drain ?pin is +3.3v pte2/vsynco oscillator portb ddrb ptb7/pwm7?tb0/pwm0 security module monitor mode entry module hsync vsync portc ddrc ptc5/adc5?tc0/adc0 porta ddra pta7/pwm15?ta0/pwm8 power v ss v dd v ss1 v dd3 voltage regulator f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description pin assignments mc68HC08BD24 ? rev. 1.0 technical data motorola general description 25 1.5 pin assignments figure 1-2. 44-pin qfp pin assignments 44 34 43 42 41 40 39 38 37 36 35 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 22 33 32 31 30 29 28 27 26 25 24 12 23 osc2 ptc4/adc4 irq pte0/sog/tch0 osc1 vss rst ptb7/pwm7 ptb6/pwm6 ptb5/pwm5 ptc5/adc5 pta3/pwm11 pta5/pwm13 pta6/pwm14 pta7/pwm15 pta4/pwm12 pta2/pwm10 ptd5 ptd6 pta0/pwm8 ptd4/clamp pta1/pwm9 ptb0/pwm0 pte1/hsynco pte2/vsynco ptb4/pwm4 ptb3/pwm3 ptd3/ddcscl ptd2/ddcsda vss1 ptb2/pwm2 ptb1/pwm1 nc vdd3 vsync pd1 pd0 nc ptc3/adc3 ptc2/adc2 ptc1/adc1 ptc0/adc0 hsync vdd note: 2. ptd0, ptd1, osc1, osc2 are 3.3v pins 1. nc = no connection f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description technical data mc68HC08BD24 ? rev. 1.0 26 general description motorola figure 1-3. 42-pin sdip pin assignments 21 22 pta2/pwm10 pta3/pwm11 ptd5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 ptd6 pta0/pwm8 pta5/pwm13 pta6/pwm14 pta7/pwm15 osc2 ptc4/adc4 irq pte0/sog/tch0 ptb0/pwm0 pte1/hsynco pte2/vsynco ptc3/adc3 ptc2/adc2 ptc1/adc1 ptc0/adc0 hsync ptb4/pwm4 ptb3/pwm3 ptd3/ddcscl ptd2/ddcsda vss1 vdd3 vsync ptb2/pwm2 ptb1/pwm1 pd1 pd0 vdd osc1 vss rst ptb7/pwm7 ptb6/pwm6 ptb5/pwm5 ptc5/adc5 ptd4/clamp 20 23 pta1/pwm9 pta4/pwm12 note: ptd0, ptd1, osc1, osc2 are 3.3v pins f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description pin functions mc68HC08BD24 ? rev. 1.0 technical data motorola general description 27 1.6 pin functions description of the pin functions are provided in table 1-1 . table 1-1. pin functions pin name pin description vdd power supply input to the mcu. vss power supply ground. vdd3 3.3v regulated output from the mcu. vss1 power supply ground. osc1 osc2 connections to the on-chip oscillator. an external clock can be connected directly to osc1; with osc2 floating. these are 3.3v pins. see section 8. oscillator (osc) . rst a logic 0 on the rst pin forces the mcu to a known startup state. rst is bidirectional, allowing a reset of the entire system. it is driven low when any internal reset source is asserted. this pin contains an internal pullup resistor. see section 7. system integration module (sim) . irq external irq pin; with software programmable internal pull-up and schmitt trigger input. this pin is also used for mode entry selection. see section 7. system integration module (sim) . vsync vsync input to the sync processor. see section 14. sync processor . hsync hsync input to the sync processor. see section 14. sync processor . pta7/pwm15?ta0/pwm8 these are shared-function pins. each pin can be configured as a standard i/o pin or a pwm output channel. see section 15. input/output (i/o) ports and section 11. pulse width modulator (pwm) . ptb7/pwm7?tb0/pwm0 these are shared-function pins. each pin can be configured as a standard i/o pin or a pwm output channel. see section 15. input/output (i/o) ports and section 11. pulse width modulator (pwm) . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description technical data mc68HC08BD24 ? rev. 1.0 28 general description motorola ptc5/adc5?tc0/adc0 these are shared-function pins. each pin can be configured as a standard i/o pin or an adc input channel. see section 15. input/output (i/o) ports and section 12. analog-to-digital converter (adc) . ptd6, ptd5 these two are standard i/o pins. these pins are open-drain when configured as outputs. see section 15. input/output (i/o) ports . ptd4/clamp this is a shared function pin. it can be configured as a standard i/o pin or the clamp output from the sync processor. see section 15. input/output (i/o) ports and section 14. sync processor . ptd3/ddcscl this is a shared function pin. it can be configured as a standard i/o pin or as the clock line of the ddc12ab module. this pin is open-drain when configured as output. see section 15. input/output (i/o) ports and section 13. ddc12ab interface . ptd2/ddcsda this is a shared function pin. it can be configured as a standard i/o pin or the data line of the ddc12ab module. this pin is open-drain when configured as output. see section 15. input/output (i/o) ports and section 13. ddc12ab interface . ptd1, ptd0 these are 3.3v, standard i/o pins. see section 15. input/output (i/o) ports . pte2/vsynco this is a shared function pin. it can be configured as a standard i/o pin or the hsync output from the sync processor. see section 15. input/output (i/o) ports and section 14. sync processor . pte1/hsynco this is a shared function pin. it can be configured as a standard i/o pin or the vsync output from the sync processor. see section 15. input/output (i/o) ports and section 14. sync processor . table 1-1. pin functions pin name pin description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description pin functions mc68HC08BD24 ? rev. 1.0 technical data motorola general description 29 note: any unused inputs and i/o ports should be tied to an appropriate logic level (either v dd or v ss ; v dd3 or v ss for 3.3v pins). although the i/o ports of the mc68HC08BD24 do not require termination, termination is recommended to reduce the possibility of static damage. pte0/sog/tch0 this is a shared function pin. it can be configured as a standard i/o pin, the sog input to the sync processor, or the timer channel 0 i/o pin. see section 15. input/output (i/o) ports , section 14. sync processor , and section 10. timer interface module (tim) . table 1-1. pin functions pin name pin description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description technical data mc68HC08BD24 ? rev. 1.0 30 general description motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola memory map 31 technical data ?mc68HC08BD24 section 2. memory map 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.3 unimplemented memory locations . . . . . . . . . . . . . . . . . . . . . 31 2.4 reserved memory locations . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.5 input/output (i/o) section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.2 introduction the cpu08 can address 64 kbytes of memory space. the memory map, shown in figure 2-1 , includes: 24,576 + 512 bytes of read-only memory (rom) 512 bytes of random-access memory (ram) 26 bytes of user-defined vectors 470 bytes of monitor rom 2.3 unimplemented memory locations accessing an unimplemented location can cause an illegal address reset if illegal address resets are enabled. in the memory map ( figure 2-1 ) and in register figures in this document, unimplemented locations are shaded. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map technical data mc68HC08BD24 ? rev. 1.0 32 memory map motorola 2.4 reserved memory locations accessing a reserved location can have unpredictable effects on mcu operation. in the figure 2-1 and in register figures in this document, reserved locations are marked with the word reserved or with the letter r. 2.5 input/output (i/o) section most of the control, status, and data registers are in the zero page area of $0000?005f. additional i/o registers have these addresses: $fe00; sim break status register, sbsr $fe01; sim reset status register, srsr $fe02; reserved $fe03; sim break flag control register, sbfcr $fe04; interrupt status register 1, int1 $fe05; interrupt status register 2, int2 $fe06; reserved $fe07; reserved $fe08; reserved $fe09; reserved $fe0a; reserved $fe0b; reserved $fe0c; break address register high, brkh $fe0d; break address register low, brkl $fe0e; break status and control register, brkscr data registers are shown in figure 2-2 . table 2-1 is a list of vector locations. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map input/output (i/o) section mc68HC08BD24 ? rev. 1.0 technical data motorola memory map 33 $0000 i/o registers 96 bytes $005f $0060 unimplemented 32 bytes $007f $0080 ram 512 bytes $027f $0280 unimplemented 39,296 bytes $9bff $9c00 user rom 24,576 bytes $fbff $fc00 user rom 512 bytes $fdff $fe00 sim break status register (sbsr) $fe01 sim reset status register (srsr) $fe02 reserved $fe03 sim break flag control register (sbfcr) $fe04 interrupt status register 1 (int1) $fe05 interrupt status register 2 (int2) $fe06 reserved $fe07 reserved $fe08 reserved $fe09 reserved $fe0a reserved figure 2-1. memory map f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map technical data mc68HC08BD24 ? rev. 1.0 34 memory map motorola $fe0b reserved $fe0c break address register high (brkh) $fe0d break address register low (brkl) $fe0e break status and control register (brkscr) $fe0f reserved $fe10 monitor rom 470 bytes $ffe5 $ffe6 user rom vectors 26 bytes $ffff figure 2-1. memory map (continued) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map input/output (i/o) section mc68HC08BD24 ? rev. 1.0 technical data motorola memory map 35 addr. register name bit 7 654321 bit 0 $0000 port a data register (pta) read: pta7 pta6 pta5 pta4 pta3 pta2 pta1 pta0 write: reset: unaffected by reset $0001 port b data register (ptb) read: ptb7 ptb6 ptb5 ptb4 ptb3 ptb2 ptb1 ptb0 write: reset: unaffected by reset $0002 port c data register (ptc) read: 0 0 ptc5 ptc4 ptc3 ptc2 ptc1 ptc0 write: reset: unaffected by reset $0003 port d data register (ptd) read: 0 ptd6 ptd5 ptd4 ptd3 ptd2 ptd1 ptd0 write: reset: unaffected by reset $0004 data direction register a (ddra) read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset: 00000000 $0005 data direction register b (ddrb) read: ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 write: reset: 00000000 $0006 data direction register c (ddrc) read: 0 0 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 00000000 $0007 data direction register d (ddrd) read: 0 ddrd6 ddrd5 ddrd4 ddrd3 ddrd2 ddrd1 ddrd0 write: reset: 00000000 $0008 port e data register (pte) read: 00000 pte2 pte1 pte0 write: reset: unaffected by reset $0009 data direction register e (ddre) read: 00000 ddre2 ddre1 ddre0 write: reset: 00000000 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 1 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map technical data mc68HC08BD24 ? rev. 1.0 36 memory map motorola $000a tim status and control register (tsc) read: tof toie tstop 00 ps2 ps1 ps0 write: 0 trst reset: 00100000 $000b unimplemented read: write: reset: 00000000 $000c tim counter register high (tcnth) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 00000000 $000d tim counter register low (tcntl) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 00000000 $000e tim counter modulo register high (tmodh) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 11111111 $000f tim counter modulo register low (tmodl) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 11111111 $0010 tim channel 0 status and control register (tsc0) read: ch0f ch0ie ms0b ms0a els0b els0a tov0 ch0max write: 0 reset: 00000000 $0011 tim channel 0 register high (tch0h) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: indeterminate after reset $0012 tim channel 0 register low (tch0l) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: indeterminate after reset $0013 tim channel 1 status and control register (tsc1) read: ch1f ch1ie 0 ms1a els1b els1a tov1 ch1max write: 0 reset: 00000000 addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 2 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map input/output (i/o) section mc68HC08BD24 ? rev. 1.0 technical data motorola memory map 37 $0014 tim channel 1 register high (tch1h) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: indeterminate after reset $0015 tim channel 1 register low (tch1l) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: indeterminate after reset $0016 ddc master control register (dmcr) read: alif nakif bb mast mrw br2 br1 br0 write: reset: 00000000 $0017 ddc address register (dadr) read: dad7 dad6 dad5 dad4 dad3 dad2 dad1 extad write: reset: 10100000 $0018 ddc control register (dcr) read: den dien 00 txak sclien ddc1en 0 write: reset: 00000000 $0019 ddc status register (dsr) read: rxif txif match srw rxak sclif txbe rxbf write: 0 0 0 reset: 00001010 $001a ddc data transmit register (ddtr) read: dtd7 dtd6 dtd5 dtd4 dtd3 dtd2 dtd1 dtd0 write: reset: 11111111 $001b ddc data receive register (ddrr) read: drd7 drd6 drd5 drd4 drd3 drd2 drd1 drd0 write: reset: 00000000 $001c ddc2 address register (d2adr) read: d2ad7 d2ad6 d2ad5 d2ad4 d2ad3 d2ad2 d2ad1 0 write: reset: 00000000 $001d configuration register 0 (config0) read: hsyncoe vsyncoe soge 00000 write: reset: 00000000 addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 3 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map technical data mc68HC08BD24 ? rev. 1.0 38 memory map motorola $001e irq status and control register (intscr) read: 0000 irqf 0 imask mode write: ack reset: 00000000 $001f configuration register 1 (config1) ? read: 0000 ssrec coprs stop copd write: reset: 00000000 ? one-time writable register after each reset. $0020 pwm0 data register (0pwm) read: 0pwm4 0pwm3 0pwm2 0pwm1 0pwm0 0brm2 0brm1 0brm0 write: reset: 00000000 $0021 pwm1 data register (1pwm) read: 1pwm4 1pwm3 1pwm2 1pwm1 1pwm0 1brm2 1brm1 1brm0 write: reset: 00000000 $0022 pwm2 data register (2pwm) read: 2pwm4 2pwm3 2pwm2 2pwm1 2pwm0 2brm2 2brm1 2brm0 write: reset: 00000000 $0023 pwm3 data register (3pwm) read: 3pwm4 3pwm3 3pwm2 3pwm1 3pwm0 3brm2 3brm1 3brm0 write: reset: 00000000 $0024 pwm4 data register (4pwm) read: 4pwm4 4pwm3 4pwm2 4pwm1 4pwm0 4brm2 4brm1 4brm0 write: reset: 00000000 $0025 pwm5 data register (5pwm) read: 5pwm4 5pwm3 5pwm2 5pwm1 5pwm0 5brm2 5brm1 5brm0 write: reset: 00000000 $0026 pwm6 data register (6pwm) read: 6pwm4 6pwm3 6pwm2 6pwm1 6pwm0 6brm2 6brm1 6brm0 write: reset: 00000000 $0027 pwm7 data register (7pwm) read: 7pwm4 7pwm3 7pwm2 7pwm1 7pwm0 7brm2 7brm1 7brm0 write: reset: 00000000 addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 4 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map input/output (i/o) section mc68HC08BD24 ? rev. 1.0 technical data motorola memory map 39 $0028 pwm control register 1 (pwmcr1) read: pwm7e pwm6e pwm5e pwm4e pwm3e pwm2e pwm1e pwm0e write: reset: 00000000 $0029 reserved read: rrrrrrrr write: reset: $002a reserved read: rrrrrrrr write: reset: $002b reserved read: rrrrrrrr write: reset: $002c reserved read: rrrrrrrr write: reset: $002d reserved read: rrrrrrrr write: reset: $002e reserved read: rrrrrrrr write: reset: $002f reserved read: rrrrrrrr write: reset: $0030 reserved read: rrrrrrrr write: reset: $0031 reserved read: rrrrrrrr write: reset: addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 5 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map technical data mc68HC08BD24 ? rev. 1.0 40 memory map motorola $0032 reserved read: rrrrrrrr write: reset: $0033 reserved read: rrrrrrrr write: reset: $0034 reserved read: rrrrrrrr write: reset: $0035 reserved read: rrrrrrrr write: reset: $0036 reserved read: rrrrrrrr write: reset: $0037 reserved read: rrrrrrrr write: reset: $0038 reserved read: rrrrrrrr write: reset: $0039 reserved read: rrrrrrrr write: reset: $003a reserved read: rrrrrrrr write: reset: $003b reserved read: rrrrrrrr write: reset: addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 6 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map input/output (i/o) section mc68HC08BD24 ? rev. 1.0 technical data motorola memory map 41 $003c reserved read: rrrrrrrr write: reset: $003d reserved read: rrrrrrrr write: reset: $003e reserved read: rrrrrrrr write: reset: $003f reserved read: rrrrrrrr write: reset: $0040 sync processor control and status register (spcsr) read: vsie vedge vsif comp vinvo hinvo vpol hpol write: 0 reset: 00000000 $0041 vertical frequency high register (vfhr) read: vof 0 0 vf12 vf11 vf10 vf9 vf8 write: cpw1 cpw0 reset: 00000000 $0042 vertical frequency low register (vflr) read: vf7 vf6 vf5 vf4 vf3 vf2 vf1 vf0 write: reset: 00000000 $0043 hsync frequency high register (hfhr) read: hfh7 hfh6 hfh5 hfh4 hfh3 hfh2 hfh1 hfh0 write: reset: 00000000 $0044 hsync frequency low register (hflr) read: hover 0 0 hfl4 hfl3 hfl2 hfl1 hfl0 write: reset: 00000000 $0045 sync processor i/o control register (spiocr) read: vsyncs hsyncs coinv r sogsel clampoe bpor sout write: reset: 00000000 addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 7 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map technical data mc68HC08BD24 ? rev. 1.0 42 memory map motorola $0046 sync processor control register 1 (spcr1) read: lvsie lvsif hps1 hps0 r r atpol fshf write: 0 reset: 00000000 $0047 h&v sync output control register (hvocr) read: r 0000 hvocr2 hvocr1 hvocr0 write: reset: 00000000 $0048 unimplemented read: write: reset: $0049 port d configuration register (pdcr) read: 0 0 0 clampe ddcscle ddcdate 00 write: reset: 00000000 $004a reserved read: rrrrrrrr write: reset: $004b reserved read: rrrrrrrr write: reset: $004c reserved read: rrrrrrrr write: reset: $004d reserved read: rrrrrrrr write: reset: $004e reserved read: rrrrrrrr write: reset: $004f reserved read: rrrrrrrr write: reset: addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 8 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map input/output (i/o) section mc68HC08BD24 ? rev. 1.0 technical data motorola memory map 43 $0050 unimplemented read: write: reset: $0051 pwm8 data register (8pwm) read: 8pwm4 8pwm3 8pwm2 8pwm1 8pwm0 8brm2 8brm1 8brm0 write: reset: 00000000 $0052 pwm9 data register (9pwm) read: 9pwm4 9pwm3 9pwm2 9pwm1 9pwm0 9brm2 9brm1 9brm0 write: reset: 00000000 $0053 pwm10 data register (10pwm) read: 10pwm4 10pwm3 10pwm2 10pwm1 10pwm0 10brm2 10brm1 10brm0 write: reset: 00000000 $0054 pwm11 data register (11pwm) read: 11pwm4 11pwm3 11pwm2 11pwm1 11pwm0 11brm2 11brm1 11brm0 write: reset: 00000000 $0055 pwm12 data register (12pwm) read: 12pwm4 12pwm3 12pwm2 12pwm1 12pwm0 12brm2 12brm1 12brm0 write: reset: 00000000 $0056 pwm13 data register (13pwm) read: 13pwm4 13pwm3 13pwm2 13pwm1 13pwm0 13brm2 13brm1 13brm0 write: reset: 00000000 $0057 pwm14 data register (14pwm) read: 14pwm4 pwm3 14pwm2 14pwm1 14pwm0 14brm2 14brm1 14brm0 write: reset: 00000000 $0058 pwm15 data register (15pwm) read: 15pwm4 15pwm3 15pwm2 15pwm1 15pwm0 15brm2 15brm1 15brm0 write: reset: 00000000 $0059 pwm control register 2 (pwmcr2) read: pwm15e pwm14e pwm13e pwm12e pwm11e pwm10e pwm9e pwm8e write: reset: 00000000 addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 9 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map technical data mc68HC08BD24 ? rev. 1.0 44 memory map motorola $005a unimplemented read: write: reset: $005b unimplemented read: write: reset: $005c unimplemented read: write: reset: $005d adc status and control register (adscr) read: coco aien adco adch4 adch3 adch2 adch1 adch0 write: reset: 00011111 $005e adc data register (adr) read: ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 write: reset: unaffected after reset $005f adc input clock register (adiclk) read: adiv2 adiv1 adiv0 00000 write: reset: 00000000 $fe00 sim break status register (sbsr) read: rrrrrr sbsw r write: note reset: 00000000 note: writing a logic 0 clears sbsw. $fe01 sim reset status register (srsr) read: por pin cop ilop ilad 0 0 0 write: por: 10000000 $fe02 reserved read: rrrrrrrr write: reset: 00000000 addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 10 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map input/output (i/o) section mc68HC08BD24 ? rev. 1.0 technical data motorola memory map 45 $fe03 sim break flag control register (sbfcr) read: bcfe rrrrrrr write: reset: 0 $fe04 interrupt status register 1 (int1) read: if6 if5 if4 if3 if2 if1 0 0 write: rrrrrrrr reset: 00000000 $fe05 interrupt status register 2 (int2) read: 0000 if10 if9 if8 if7 write: rrrrrrrr reset: 00000000 $fe06 reserved read: rrrrrrrr write: reset: 00000000 $fe07 reserved read: rrrrrrrr write: reset: 00000000 $fe08 reserved read: rrrrrrrr write: reset: 00000000 $fe09 reserved read: rrrrrrrr write: reset: 00000000 $fe0a reserved read: rrrrrrrr write: reset: 00000000 $fe0b reserved read: rrrrrrrr write: reset: 00000000 $fe0c break address high register (brkh) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 00000000 addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 11 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map technical data mc68HC08BD24 ? rev. 1.0 46 memory map motorola $fe0d break address low register (brkl) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 00000000 $fe0e break status and control register (brkscr) read: brke brka 000000 write: reset: 00000000 $ffff cop control register (copctl) read: low byte of reset vector write: writing clears cop counter (any value) reset: unaffected by reset addr. register name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (sheet 12 of 12) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map input/output (i/o) section mc68HC08BD24 ? rev. 1.0 technical data motorola memory map 47 . table 2-1. vector addresses vector priority vector address vector lowest $ffe6 reserved $ffe7 reserved if10 $ffe8 adc interrupt vector (high) $ffe9 adc interrupt vector (low) if9 $ffea reserved $ffeb reserved if8 $ffec sync processor vector (high) $ffed sync processor vector (low) if7 $ffee tim overflow vector (high) $ffef tim overflow vector (low) if6 $fff0 tim channel 1 vector (high) $fff1 tim channel 1 vector (low) if5 $fff2 tim channel 0 vector (high) $fff3 tim channel 0 vector (low) if4 $fff4 reserved $fff5 reserved if3 $fff6 ddc12ab vector (high) $fff7 ddc12ab vector (low) if2 $fff8 reserved $fff9 reserved if1 $fffa irq vector (high) $fffb irq vector (low) $fffc swi vector (high) $fffd swi vector (low) $fffe reset vector (high) highest $ffff reset vector (low) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map technical data mc68HC08BD24 ? rev. 1.0 48 memory map motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola random-access memory (ram) 49 technical data ?mc68HC08BD24 section 3. random-access memory (ram) 3.1 contents 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 3.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 3.2 introduction this section describes the 512 bytes of ram (random-access memory). 3.3 functional description addresses $0080 through $027f are ram locations. the location of the stack ram is programmable. the 16-bit stack pointer allows the stack to be anywhere in the 64-kbyte memory space. note: for correct operation, the stack pointer must point only to ram locations. within page zero are 128 bytes of ram. because the location of the stack ram is programmable, all page zero ram locations can be used for i/o control and user data or code. when the stack pointer is moved from its reset location at $00ff out of page zero, direct addressing mode instructions can efficiently access all page zero ram locations. page zero ram, therefore, provides ideal locations for frequently accessed global variables. before processing an interrupt, the cpu uses five bytes of the stack to save the contents of the cpu registers. note: for m6805 compatibility, the h register is not stacked. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
random-access memory (ram) technical data mc68HC08BD24 ? rev. 1.0 50 random-access memory (ram) motorola during a subroutine call, the cpu uses two bytes of the stack to store the return address. the stack pointer decrements during pushes and increments during pulls. note: be careful when using nested subroutines. the cpu may overwrite data in the ram during a subroutine or during the interrupt stacking operation. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola read-only memory (rom) 51 technical data ?mc68HC08BD24 section 4. read-only memory (rom) 4.1 contents 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.2 introduction this section describes the 25,088 bytes of rom (read-only memory). 4.3 functional description these addresses are user rom locations: $9c00 ?$fbff (24,576 bytes) $fc00 ?$fdff (512 bytes) $ffe6 ?$ffff (these locations are reserved for user-defined interrupt and reset vectors.) note: a security feature prevents viewing of the rom contents. 1 1. no security feature is absolutely secure. however, motorola? strategy is to make reading or copying the rom contents difficult for unauthorized users. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
read-only memory (rom) technical data mc68HC08BD24 ? rev. 1.0 52 read-only memory (rom) motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola configuration register (config) 53 technical data ?mc68HC08BD24 section 5. configuration register (config) 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.3 configuration register 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.4 configuration register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.2 introduction this section describes the configuration registers, config0 and config1. the configuration registers enable or disable these options: sync processor hsynco output pin sync processor vsynco output pin sync processor sog input pin stop mode recovery time (32 oscxclk cycles or 4096 oscxclk cycles) cop timeout period (2 18 ?2 4 or 2 13 ?2 4 oscxclk cycles) stop instruction computer operating properly module (cop) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
con?uration register (config) technical data mc68HC08BD24 ? rev. 1.0 54 configuration register (config) motorola 5.3 configuration register 0 the config0 register is used to select the i/o pins for sync processor output functions. hsyncoe ?vsynco enable this bit is set to configure the pte1/hsynco pin for hsynco output function. reset clears this bit. 1 = pte1/hsynco pin configured as hsynco pin 0 = pte1/hsynco pin configured as standard i/o pin vsyncoe ?vsynco enable this bit is set to configure the pte2/vsynco pin for vsynco output function. reset clears this bit. 1 = pte2/vsynco pin configured as vsynco pin 0 = pte2/vsynco pin configured as standard i/o pin soge ?sog enable this bit is set to configure the pte0/sog/tch0 pin for sog output function. reset clears this bit. 1 = pte0/sog/tch0 pin configured as sog pin 0 = pte0/sog/tch0 pin configured as standard i/o or tch0 pin. tch0 function is configured by els0b and els0a bits in tsc0 (bits 3 and 2 in $0010). (see 10.10.4 tim channel status and control registers (tsc0:tsc1) .) address: $001d bit 7 654321 bit 0 read: hsyncoe vsyncoe soge 00000 write: reset: 00000000 = unimplemented figure 5-1. configuration register 0 (config0) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
configuration register (config) configuration register 1 mc68HC08BD24 ? rev. 1.0 technical data motorola configuration register (config) 55 5.4 configuration register 1 the config1 register is used in the initialization of various mcu options. it can only be written once after each reset. all of the config1 register bits are cleared during reset. since the various options affect the operation of the mcu, it is recommended that the config1 register be written immediately after reset. ssrec ?short stop recovery bit ssrec enables the cpu to exit stop mode with a delay of 32 oscxclk cycles instead of a 4096-oscxclk cycle delay. 1 = stop mode recovery after 32 oscxclk cycles 0 = stop mode recovery after 4096 oscxclk cycles note: exiting stop mode by pulling reset will result in the long stop recovery. if using an external crystal oscillator, do not set the ssrec bit. coprs ?cop rate select bit coprs selects the cop timeout period. reset clears coprs. (see section 17. computer operating properly (cop) .) 1 = cop timeout period = 2 13 ?2 4 cgmxclk cycles 0 = cop timeout period = 2 18 ?2 4 cgmxclk cycles stop ?stop instruction enable bit stop enables the stop instruction. 1 = stop instruction enabled 0 = stop instruction treated as illegal opcode address: $001f bit 7 654321 bit 0 read: 0000 ssrec coprs stop copd write: reset: 00000000 register is write-once after reset. = unimplemented figure 5-2. configuration register 1 (config1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
con?uration register (config) technical data mc68HC08BD24 ? rev. 1.0 56 configuration register (config) motorola copd ?cop disable bit copd disables the cop module. (see section 17. computer operating properly (cop) .) 1 = cop module disabled 0 = cop module enabled f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 57 technical data ?mc68HC08BD24 section 6. central processor unit (cpu) 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.4 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.4.1 accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.4.2 index register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.4.3 stack pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.4.4 program counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.4.5 condition code register . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.5 arithmetic/logic unit (alu) . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.6 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.6.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.6.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.7 cpu during break interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.8 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.9 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.2 introduction the m68hc08 cpu (central processor unit) is an enhanced and fully object-code-compatible version of the m68hc05 cpu. the cpu08 reference manual (motorola document order number cpu08rm/ad) contains a description of the cpu instruction set, addressing modes, and architecture. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 58 central processor unit (cpu) motorola 6.3 features object code fully upward-compatible with m68hc05 family 16-bit stack pointer with stack manipulation instructions 16-bit index register with x-register manipulation instructions 6-mhz cpu internal bus frequency 64-kbyte program/data memory space 16 addressing modes memory-to-memory data moves without using accumulator fast 8-bit by 8-bit multiply and 16-bit by 8-bit divide instructions enhanced binary-coded decimal (bcd) data handling modular architecture with expandable internal bus definition for extension of addressing range beyond 64 kbytes low-power stop and wait modes 6.4 cpu registers figure 6-1 shows the five cpu registers. cpu registers are not part of the memory map. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) cpu registers mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 59 figure 6-1. cpu registers 6.4.1 accumulator the accumulator is a general-purpose 8-bit register. the cpu uses the accumulator to hold operands and the results of arithmetic/logic operations. accumulator (a) index register (h:x) stack pointer (sp) program counter (pc) condition code register (ccr) carry/borrow flag zero flag negative flag interrupt mask half-carry flag two? complement overflow flag v1 1h i nzc h x 0 0 0 0 7 15 15 15 70 bit 7 654321 bit 0 read: write: reset: unaffected by reset figure 6-2. accumulator (a) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 60 central processor unit (cpu) motorola 6.4.2 index register the 16-bit index register allows indexed addressing of a 64-kbyte memory space. h is the upper byte of the index register, and x is the lower byte. h:x is the concatenated 16-bit index register. in the indexed addressing modes, the cpu uses the contents of the index register to determine the conditional address of the operand. the index register can serve also as a temporary data storage location. 6.4.3 stack pointer the stack pointer is a 16-bit register that contains the address of the next location on the stack. during a reset, the stack pointer is preset to $00ff. the reset stack pointer (rsp) instruction sets the least significant byte to $ff and does not affect the most significant byte. the stack pointer decrements as data is pushed onto the stack and increments as data is pulled from the stack. in the stack pointer 8-bit offset and 16-bit offset addressing modes, the stack pointer can function as an index register to access data on the stack. the cpu uses the contents of the stack pointer to determine the conditional address of the operand. bit 15 1413121110987654321 bit 0 read: write: reset: 00000000 xxxxxxxx x = indeterminate figure 6-3. index register (h:x) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) cpu registers mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 61 note: the location of the stack is arbitrary and may be relocated anywhere in ram. moving the sp out of page 0 ($0000 to $00ff) frees direct address (page 0) space. for correct operation, the stack pointer must point only to ram locations. 6.4.4 program counter the program counter is a 16-bit register that contains the address of the next instruction or operand to be fetched. normally, the program counter automatically increments to the next sequential memory location every time an instruction or operand is fetched. jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. during reset, the program counter is loaded with the reset vector address located at $fffe and $ffff. the vector address is the address of the first instruction to be executed after exiting the reset state. 6.4.5 condition code register the 8-bit condition code register contains the interrupt mask and five flags that indicate the results of the instruction just executed. bits 6 and bit 15 1413121110987654321 bit 0 read: write: reset: 0000000011111111 figure 6-4. stack pointer (sp) bit 15 1413121110987654321 bit 0 read: write: reset: loaded with vector from $fffe and $ffff figure 6-5. program counter (pc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 62 central processor unit (cpu) motorola 5 are set permanently to logic 1. the following paragraphs describe the functions of the condition code register. v ?overflow flag the cpu sets the overflow flag when a two's complement overflow occurs. the signed branch instructions bgt, bge, ble, and blt use the overflow flag. 1 = overflow 0 = no overflow h ?half-carry flag the cpu sets the half-carry flag when a carry occurs between accumulator bits 3 and 4 during an add-without-carry (add) or add- with-carry (adc) operation. the half-carry flag is required for binary- coded decimal (bcd) arithmetic operations. the daa instruction uses the states of the h and c flags to determine the appropriate correction factor. 1 = carry between bits 3 and 4 0 = no carry between bits 3 and 4 bit 7 654321 bit 0 read: v1 1h i nzc write: reset: x 1 1x1xxx x = indeterminate figure 6-6. condition code register (ccr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) cpu registers mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 63 i ?interrupt mask when the interrupt mask is set, all maskable cpu interrupts are disabled. cpu interrupts are enabled when the interrupt mask is cleared. when a cpu interrupt occurs, the interrupt mask is set automatically after the cpu registers are saved on the stack, but before the interrupt vector is fetched. 1 = interrupts disabled 0 = interrupts enabled note: to maintain m6805 family compatibility, the upper byte of the index register (h) is not stacked automatically. if the interrupt service routine modifies h, then the user must stack and unstack h using the pshh and pulh instructions. after the i bit is cleared, the highest-priority interrupt request is serviced first. a return-from-interrupt (rti) instruction pulls the cpu registers from the stack and restores the interrupt mask from the stack. after any reset, the interrupt mask is set and can be cleared only by the clear interrupt mask software instruction (cli). n ?negative flag the cpu sets the negative flag when an arithmetic operation, logic operation, or data manipulation produces a negative result, setting bit 7 of the result. 1 = negative result 0 = non-negative result z ?zero flag the cpu sets the zero flag when an arithmetic operation, logic operation, or data manipulation produces a result of $00. 1 = zero result 0 = non-zero result f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 64 central processor unit (cpu) motorola c ?carry/borrow flag the cpu sets the carry/borrow flag when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. some instructions ?such as bit test and branch, shift, and rotate ?also clear or set the carry/borrow flag. 1 = carry out of bit 7 0 = no carry out of bit 7 6.5 arithmetic/logic unit (alu) the alu performs the arithmetic and logic operations defined by the instruction set. refer to the cpu08 reference manual (motorola document order number cpu08rm/ad) for a description of the instructions and addressing modes and more detail about the architecture of the cpu. 6.6 low-power modes the wait and stop instructions put the mcu in low power-consumption standby modes. 6.6.1 wait mode the wait instruction: clears the interrupt mask (i bit) in the condition code register, enabling interrupts. after exit from wait mode by interrupt, the i bit remains clear. after exit by reset, the i bit is set. disables the cpu clock f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) cpu during break interrupts mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 65 6.6.2 stop mode the stop instruction: clears the interrupt mask (i bit) in the condition code register, enabling external interrupts. after exit from stop mode by external interrupt, the i bit remains clear. after exit by reset, the i bit is set. disables the cpu clock after exiting stop mode, the cpu clock begins running after the oscillator stabilization delay. 6.7 cpu during break interrupts if a break module is present on the mcu, the cpu starts a break interrupt by: loading the instruction register with the swi instruction loading the program counter with $fffc:$fffd or with $fefc:$fefd in monitor mode the break interrupt begins after completion of the cpu instruction in progress. if the break address register match occurs on the last cycle of a cpu instruction, the break interrupt begins immediately. a return-from-interrupt instruction (rti) in the break routine ends the break interrupt and returns the mcu to normal operation if the break interrupt has been deasserted. 6.8 instruction set summary 6.9 opcode map see table 6-2 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 66 central processor unit (cpu) motorola table 6-1. instruction set summary source form operation description effect on ccr address mode opcode operand cycles vh i nzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x adc opr ,sp adc opr ,sp add with carry a ? (a) + (m) + (c) imm dir ext ix2 ix1 ix sp1 sp2 a9 b9 c9 d9 e9 f9 9ee9 9ed9 ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 add # opr add opr add opr add opr ,x add opr ,x add ,x add opr ,sp add opr ,sp add without carry a ? (a) + (m) imm dir ext ix2 ix1 ix sp1 sp2 ab bb cb db eb fb 9eeb 9edb ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 ais # opr add immediate value (signed) to sp sp ? (sp) + (16 ?m) imm a7 ii 2 aix # opr add immediate value (signed) to h:x h:x ? (h:x) + (16 ?m) imm af ii 2 and # opr and opr and opr and opr ,x and opr ,x and ,x and opr ,sp and opr ,sp logical and a ? (a) & (m) 0 imm dir ext ix2 ix1 ix sp1 sp2 a4 b4 c4 d4 e4 f4 9ee4 9ed4 ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 asl opr asla aslx asl opr ,x asl ,x asl opr ,sp arithmetic shift left (same as lsl) dir inh inh ix1 ix sp1 38 48 58 68 78 9e68 dd ff ff 4 1 1 4 3 5 asr opr asra asrx asr opr ,x asr opr ,x asr opr ,sp arithmetic shift right dir inh inh ix1 ix sp1 37 47 57 67 77 9e67 dd ff ff 4 1 1 4 3 5 bcc rel branch if carry bit clear pc ? (pc) + 2 + rel ? (c) = 0 rel 24 rr 3 bclr n , opr clear bit n in m mn ? 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 4 4 4 4 4 4 4 4 c b0 b7 0 b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) opcode map mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 67 bcs rel branch if carry bit set (same as blo) pc ? (pc) + 2 + rel ? (c) = 1 rel 25 rr 3 beq rel branch if equal pc ? (pc) + 2 + rel ? (z) = 1 rel 27 rr 3 bge opr branch if greater than or equal to (signed operands) pc ? (pc) + 2 + rel ? (n ? v ) = 0 rel 90 rr 3 bgt opr branch if greater than (signed operands) pc ? (pc) + 2 + rel ? (z) | (n ? v ) = 0 rel 92 rr 3 bhcc rel branch if half carry bit clear pc ? (pc) + 2 + rel ? (h) = 0 rel 28 rr 3 bhcs rel branch if half carry bit set pc ? (pc) + 2 + rel ? (h) = 1 rel 29 rr 3 bhi rel branch if higher pc ? (pc) + 2 + rel ? (c) | (z) = 0 rel 22 rr 3 bhs rel branch if higher or same (same as bcc) pc ? (pc) + 2 + rel ? (c) = 0 rel 24 rr 3 bih rel branch if irq pin high pc ? (pc) + 2 + rel ? irq = 1 rel 2f rr 3 bil rel branch if irq pin low pc ? (pc) + 2 + rel ? irq = 0 rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit opr ,sp bit opr ,sp bit test (a) & (m) 0 imm dir ext ix2 ix1 ix sp1 sp2 a5 b5 c5 d5 e5 f5 9ee5 9ed5 ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 ble opr branch if less than or equal to (signed operands) pc ? (pc) + 2 + rel ? (z) | (n ? v ) = 1 rel 93 rr 3 blo rel branch if lower (same as bcs) pc ? (pc) + 2 + rel ? (c) = 1 rel 25 rr 3 bls rel branch if lower or same pc ? (pc) + 2 + rel ? (c) | (z) = 1 rel 23 rr 3 blt opr branch if less than (signed operands) pc ? (pc) + 2 + rel ? (n ? v ) = 1 rel 91 rr 3 bmc rel branch if interrupt mask clear pc ? (pc) + 2 + rel ? (i) = 0 rel 2c rr 3 bmi rel branch if minus pc ? (pc) + 2 + rel ? (n) = 1 rel 2b rr 3 bms rel branch if interrupt mask set pc ? (pc) + 2 + rel ? (i) = 1 rel 2d rr 3 bne rel branch if not equal pc ? (pc) + 2 + rel ? (z) = 0 rel 26 rr 3 bpl rel branch if plus pc ? (pc) + 2 + rel ? (n) = 0 rel 2a rr 3 bra rel branch always pc ? (pc) + 2 + rel rel 20 rr 3 table 6-1. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles vh i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 68 central processor unit (cpu) motorola brclr n , opr , rel branch if bit n in m clear pc ? (pc) + 3 + rel ? (mn) = 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc ? (pc) + 2 rel 21 rr 3 brset n , opr , rel branch if bit n in m set pc ? (pc) + 3 + rel ? (mn) = 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 bset n , opr set bit n in m mn ? 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 4 4 4 4 4 4 4 4 bsr rel branch to subroutine pc ? (pc) + 2; push (pcl) sp ? (sp) ?1; push (pch) sp ? (sp) ?1 pc ? (pc) + rel rel ad rr 4 cbeq opr,rel cbeqa # opr,rel cbeqx # opr,rel cbeq opr, x+ ,rel cbeq x+ ,rel cbeq opr, sp ,rel compare and branch if equal pc ? (pc) + 3 + rel ? (a) ?(m) = $00 pc ? (pc) + 3 + rel ? (a) ?(m) = $00 pc ? (pc) + 3 + rel ? (x) ?(m) = $00 pc ? (pc) + 3 + rel ? (a) ?(m) = $00 pc ? (pc) + 2 + rel ? (a) ?(m) = $00 pc ? (pc) + 4 + rel ? (a) ?(m) = $00 dir imm imm ix1+ ix+ sp1 31 41 51 61 71 9e61 dd rr ii rr ii rr ff rr rr ff rr 5 4 4 5 4 6 clc clear carry bit c ? 0 ?inh 98 1 cli clear interrupt mask i ? 0 0inh 9a 2 clr opr clra clrx clrh clr opr ,x clr ,x clr opr ,sp clear m ? $00 a ? $00 x ? $00 h ? $00 m ? $00 m ? $00 m ? $00 001 dir inh inh inh ix1 ix sp1 3f 4f 5f 8c 6f 7f 9e6f dd ff ff 3 1 1 1 3 2 4 table 6-1. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles vh i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) opcode map mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 69 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x cmp opr ,sp cmp opr ,sp compare a with m (a) ?(m) imm dir ext ix2 ix1 ix sp1 sp2 a1 b1 c1 d1 e1 f1 9ee1 9ed1 ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 com opr coma comx com opr ,x com ,x com opr ,sp complement (ones complement) m ? (m ) = $ff ?(m) a ? (a ) = $ff ?(m) x ? (x ) = $ff ?(m) m ? (m ) = $ff ?(m) m ? (m ) = $ff ?(m) m ? (m ) = $ff ?(m) 0 1 dir inh inh ix1 ix sp1 33 43 53 63 73 9e63 dd ff ff 4 1 1 4 3 5 cphx # opr cphx opr compare h:x with m (h:x) ?(m:m + 1) imm dir 65 75 ii ii+1 dd 3 4 cpx # opr cpx opr cpx opr cpx ,x cpx opr ,x cpx opr ,x cpx opr ,sp cpx opr ,sp compare x with m (x) ?(m) imm dir ext ix2 ix1 ix sp1 sp2 a3 b3 c3 d3 e3 f3 9ee3 9ed3 ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 daa decimal adjust a (a) 10 u inh 72 2 dbnz opr,rel dbnza rel dbnzx rel dbnz opr, x ,rel dbnz x ,rel dbnz opr, sp ,rel decrement and branch if not zero a ? (a) ?1 or m ? (m) ?1 or x ? (x) ? 1 pc ? (pc) + 3 + rel ? (result) 1 0 pc ? (pc) + 2 + rel ? (result) 1 0 pc ? (pc) + 2 + rel ? (result) 1 0 pc ? (pc) + 3 + rel ? (result) 1 0 pc ? (pc) + 2 + rel ? (result) 1 0 pc ? (pc) + 4 + rel ? (result) 1 0 dir inh inh ix1 ix sp1 3b 4b 5b 6b 7b 9e6b dd rr rr rr ff rr rr ff rr 5 3 3 5 4 6 dec opr deca decx dec opr ,x dec ,x dec opr ,sp decrement m ? (m) ?1 a ? (a) ?1 x ? (x) ?1 m ? (m) ?1 m ? (m) ?1 m ? (m) ?1 dir inh inh ix1 ix sp1 3a 4a 5a 6a 7a 9e6a dd ff ff 4 1 1 4 3 5 div divide a ? (h:a)/(x) h ? remainder inh 52 7 table 6-1. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles vh i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 70 central processor unit (cpu) motorola eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x eor opr ,sp eor opr ,sp exclusive or m with a a ? (a ? m) 0 imm dir ext ix2 ix1 ix sp1 sp2 a8 b8 c8 d8 e8 f8 9ee8 9ed8 ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 inc opr inca incx inc opr ,x inc ,x inc opr ,sp increment m ? (m) + 1 a ? (a) + 1 x ? (x) + 1 m ? (m) + 1 m ? (m) + 1 m ? (m) + 1 dir inh inh ix1 ix sp1 3c 4c 5c 6c 7c 9e6c dd ff ff 4 1 1 4 3 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x jump pc ? jump address dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc ? (pc) + n ( n = 1, 2, or 3) push (pcl); sp ? (sp) ?1 push (pch); sp ? (sp) ?1 pc ? unconditional address dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 4 5 6 5 4 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x lda opr ,sp lda opr ,sp load a from m a ? (m) 0 imm dir ext ix2 ix1 ix sp1 sp2 a6 b6 c6 d6 e6 f6 9ee6 9ed6 ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 ldhx # opr ldhx opr load h:x from m h:x ? ( m:m + 1 ) 0 imm dir 45 55 ii jj dd 3 4 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x ldx opr ,sp ldx opr ,sp load x from m x ? (m) 0 imm dir ext ix2 ix1 ix sp1 sp2 ae be ce de ee fe 9eee 9ede ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 lsl opr lsla lslx lsl opr ,x lsl ,x lsl opr ,sp logical shift left (same as asl) dir inh inh ix1 ix sp1 38 48 58 68 78 9e68 dd ff ff 4 1 1 4 3 5 table 6-1. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles vh i nzc c b0 b7 0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) opcode map mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 71 lsr opr lsra lsr x lsr opr ,x lsr ,x lsr opr ,sp logical shift right 0 dir inh inh ix1 ix sp1 34 44 54 64 74 9e64 dd ff ff 4 1 1 4 3 5 mov opr,opr mov opr, x+ mov # opr,opr mov x+ ,opr move (m) destination ? (m) source h:x ? (h:x) + 1 (ix+d, dix+) 0 dd dix+ imd ix+d 4e 5e 6e 7e dd dd dd ii dd dd 5 4 4 4 mul unsigned multiply x:a ? (x) (a) ??inh 42 5 neg opr nega negx neg opr ,x neg ,x neg opr ,sp negate (twos complement) m ? ?m) = $00 ?(m) a ? ?a) = $00 ?(a) x ? ?x) = $00 ?(x) m ? ?m) = $00 ?(m) m ? ?m) = $00 ?(m) dir inh inh ix1 ix sp1 30 40 50 60 70 9e60 dd ff ff 4 1 1 4 3 5 nop no operation none inh 9d 1 nsa nibble swap a a ? (a[3:0]:a[7:4]) inh 62 3 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x ora opr ,sp ora opr ,sp inclusive or a and m a ? (a) | (m) 0 imm dir ext ix2 ix1 ix sp1 sp2 aa ba ca da ea fa 9eea 9eda ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 psha push a onto stack push (a); sp ? (sp) ?1 inh 87 2 pshh push h onto stack push (h); sp ? (sp) ?1 inh 8b 2 pshx push x onto stack push (x); sp ? (sp) ?1 inh 89 2 pula pull a from stack sp ? (sp + 1); pull ( a ) inh 86 2 pulh pull h from stack sp ? (sp + 1); pull ( h ) inh 8a 2 pulx pull x from stack sp ? (sp + 1); pull ( x ) inh 88 2 rol opr rola rolx rol opr ,x rol ,x rol opr ,sp rotate left through carry dir inh inh ix1 ix sp1 39 49 59 69 79 9e69 dd ff ff 4 1 1 4 3 5 table 6-1. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles vh i nzc b0 b7 c 0 c b0 b7 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 72 central processor unit (cpu) motorola ror opr rora rorx ror opr ,x ror ,x ror opr ,sp rotate right through carry dir inh inh ix1 ix sp1 36 46 56 66 76 9e66 dd ff ff 4 1 1 4 3 5 rsp reset stack pointer sp ? $ff inh 9c 1 rti return from interrupt sp ? (sp) + 1; pull (ccr) sp ? (sp) + 1; pull (a) sp ? (sp) + 1; pull (x) sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 80 7 rts return from subroutine sp ? sp + 1 ; pull ( pch) sp ? sp + 1; pull (pcl) inh 81 4 sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x sbc opr ,sp sbc opr ,sp subtract with carry a ? (a) ?(m) ?(c) imm dir ext ix2 ix1 ix sp1 sp2 a2 b2 c2 d2 e2 f2 9ee2 9ed2 ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 sec set carry bit c ? 1 ?inh 99 1 sei set interrupt mask i ? 1 1inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x sta opr ,sp sta opr ,sp store a in m m ? (a) 0 dir ext ix2 ix1 ix sp1 sp2 b7 c7 d7 e7 f7 9ee7 9ed7 dd hh ll ee ff ff ff ee ff 3 4 4 3 2 4 5 sthx opr store h:x in m (m:m + 1) ? (h:x) 0 dir 35 dd 4 stop enable irq pin; stop oscillator i ? 0; stop oscillator 0inh 8e 1 stx opr stx opr stx opr ,x stx opr ,x stx ,x stx opr ,sp stx opr ,sp store x in m m ? (x) 0 dir ext ix2 ix1 ix sp1 sp2 bf cf df ef ff 9eef 9edf dd hh ll ee ff ff ff ee ff 3 4 4 3 2 4 5 table 6-1. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles vh i nzc b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) opcode map mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 73 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x sub opr ,sp sub opr ,sp subtract a ? (a) ?(m) imm dir ext ix2 ix1 ix sp1 sp2 a0 b0 c0 d0 e0 f0 9ee0 9ed0 ii dd hh ll ee ff ff ff ee ff 2 3 4 4 3 2 4 5 swi software interrupt pc ? (pc) + 1; push (pcl) sp ? (sp) ?1; push (pch) sp ? (sp) ?1; push (x) sp ? (sp) ?1; push (a) sp ? (sp) ?1; push (ccr) sp ? (sp) ?1; i ? 1 pch ? interrupt vector high byte pcl ? interrupt vector low byte 1inh 83 9 tap transfer a to ccr ccr ? (a) inh 84 2 tax transfer a to x x ? (a) inh 97 1 tpa transfer ccr to a a ? (ccr) inh 85 1 tst opr tsta tstx tst opr ,x tst ,x tst opr ,sp test for negative or zero (a) ?$00 or (x) ?$00 or (m) ?$00 0 dir inh inh ix1 ix sp1 3d 4d 5d 6d 7d 9e6d dd ff ff 3 1 1 3 2 4 tsx transfer sp to h:x h:x ? (sp) + 1 inh 95 2 txa transfer x to a a ? (x) inh 9f 1 txs transfer h:x to sp (sp) ? (h:x) ?1 inh 94 2 table 6-1. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles vh i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 74 central processor unit (cpu) motorola a accumulator n any bit c carry/borrow bit opr operand (one or two bytes) ccr condition code register pc program counter dd direct address of operand pch program counter high byte dd rr direct address of operand and relative offset of branch instruction pcl program counter low byte dd direct to direct addressing mode rel relative addressing mode dir direct addressing mode rel relative program counter offset byte dix+ direct to indexed with post increment addressing mode rr relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing sp1 stack pointer, 8-bit offset addressing mode ext extended addressing mode sp2 stack pointer 16-bit offset addressing mode ff offset byte in indexed, 8-bit offset addressing sp stack pointer h half-carry bit u unde?ed h index register high byte v over?w bit hh ll high and low bytes of operand address in extended addressing x index register low byte i interrupt mask z zero bit ii immediate operand byte & logical and imd immediate source to direct destination addressing mode | logical or imm immediate addressing mode ? logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode ? ) negation (twos complement) ix+ indexed, no offset, post increment addressing mode # immediate value ix+d indexed with post increment to direct addressing mode sign extend ix1 indexed, 8-bit offset addressing mode ? loaded with ix1+ indexed, 8-bit offset, post increment addressing mode ? if ix2 indexed, 16-bit offset addressing mode : concatenated with m memory location set or cleared n negative bit not affected table 6-1. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles vh i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola central processor unit (cpu) 75 central processor unit (cpu) opcode map table 6-2. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 sp1 ix inh inh imm dir ext ix2 sp2 ix1 sp1 ix 0 1234569e6789 abcd9ede9eef 0 5 brset0 3 dir 4 bset0 2 dir 3 bra 2 rel 4 neg 2 dir 1 nega 1 inh 1 negx 1 inh 4 neg 2 ix1 5 neg 3 sp1 3 neg 1ix 7 rti 1 inh 3 bge 2 rel 2 sub 2 imm 3 sub 2 dir 4 sub 3 ext 4 sub 3 ix2 5 sub 4 sp2 3 sub 2 ix1 4 sub 3 sp1 2 sub 1ix 1 5 brclr0 3 dir 4 bclr0 2 dir 3 brn 2 rel 5 cbeq 3 dir 4 cbeqa 3 imm 4 cbeqx 3 imm 5 cbeq 3 ix1+ 6 cbeq 4 sp1 4 cbeq 2 ix+ 4 rts 1 inh 3 blt 2 rel 2 cmp 2 imm 3 cmp 2 dir 4 cmp 3 ext 4 cmp 3 ix2 5 cmp 4 sp2 3 cmp 2 ix1 4 cmp 3 sp1 2 cmp 1ix 2 5 brset1 3 dir 4 bset1 2 dir 3 bhi 2 rel 5 mul 1 inh 7 div 1 inh 3 nsa 1 inh 2 daa 1 inh 3 bgt 2 rel 2 sbc 2 imm 3 sbc 2 dir 4 sbc 3 ext 4 sbc 3 ix2 5 sbc 4 sp2 3 sbc 2 ix1 4 sbc 3 sp1 2 sbc 1ix 3 5 brclr1 3 dir 4 bclr1 2 dir 3 bls 2 rel 4 com 2 dir 1 coma 1 inh 1 comx 1 inh 4 com 2 ix1 5 com 3 sp1 3 com 1ix 9 swi 1 inh 3 ble 2 rel 2 cpx 2 imm 3 cpx 2 dir 4 cpx 3 ext 4 cpx 3 ix2 5 cpx 4 sp2 3 cpx 2 ix1 4 cpx 3 sp1 2 cpx 1ix 4 5 brset2 3 dir 4 bset2 2 dir 3 bcc 2 rel 4 lsr 2 dir 1 lsra 1 inh 1 lsrx 1 inh 4 lsr 2 ix1 5 lsr 3 sp1 3 lsr 1ix 2 ta p 1 inh 2 txs 1 inh 2 and 2 imm 3 and 2 dir 4 and 3 ext 4 and 3 ix2 5 and 4 sp2 3 and 2 ix1 4 and 3 sp1 2 and 1ix 5 5 brclr2 3 dir 4 bclr2 2 dir 3 bcs 2 rel 4 sthx 2 dir 3 ldhx 3 imm 4 ldhx 2 dir 3 cphx 3 imm 4 cphx 2 dir 1 tpa 1 inh 2 tsx 1 inh 2 bit 2 imm 3 bit 2 dir 4 bit 3 ext 4 bit 3 ix2 5 bit 4 sp2 3 bit 2 ix1 4 bit 3 sp1 2 bit 1ix 6 5 brset3 3 dir 4 bset3 2 dir 3 bne 2 rel 4 ror 2 dir 1 rora 1 inh 1 rorx 1 inh 4 ror 2 ix1 5 ror 3 sp1 3 ror 1ix 2 pula 1 inh 2 lda 2 imm 3 lda 2 dir 4 lda 3 ext 4 lda 3 ix2 5 lda 4 sp2 3 lda 2 ix1 4 lda 3 sp1 2 lda 1ix 7 5 brclr3 3 dir 4 bclr3 2 dir 3 beq 2 rel 4 asr 2 dir 1 asra 1 inh 1 asrx 1 inh 4 asr 2 ix1 5 asr 3 sp1 3 asr 1ix 2 psha 1 inh 1 ta x 1 inh 2 ais 2 imm 3 sta 2 dir 4 sta 3 ext 4 sta 3 ix2 5 sta 4 sp2 3 sta 2 ix1 4 sta 3 sp1 2 sta 1ix 8 5 brset4 3 dir 4 bset4 2 dir 3 bhcc 2 rel 4 lsl 2 dir 1 lsla 1 inh 1 lslx 1 inh 4 lsl 2 ix1 5 lsl 3 sp1 3 lsl 1ix 2 pulx 1 inh 1 clc 1 inh 2 eor 2 imm 3 eor 2 dir 4 eor 3 ext 4 eor 3 ix2 5 eor 4 sp2 3 eor 2 ix1 4 eor 3 sp1 2 eor 1ix 9 5 brclr4 3 dir 4 bclr4 2 dir 3 bhcs 2 rel 4 rol 2 dir 1 rola 1 inh 1 rolx 1 inh 4 rol 2 ix1 5 rol 3 sp1 3 rol 1ix 2 pshx 1 inh 1 sec 1 inh 2 adc 2 imm 3 adc 2 dir 4 adc 3 ext 4 adc 3 ix2 5 adc 4 sp2 3 adc 2 ix1 4 adc 3 sp1 2 adc 1ix a 5 brset5 3 dir 4 bset5 2 dir 3 bpl 2 rel 4 dec 2 dir 1 deca 1 inh 1 decx 1 inh 4 dec 2 ix1 5 dec 3 sp1 3 dec 1ix 2 pulh 1 inh 2 cli 1 inh 2 ora 2 imm 3 ora 2 dir 4 ora 3 ext 4 ora 3 ix2 5 ora 4 sp2 3 ora 2 ix1 4 ora 3 sp1 2 ora 1ix b 5 brclr5 3 dir 4 bclr5 2 dir 3 bmi 2 rel 5 dbnz 3 dir 3 dbnza 2 inh 3 dbnzx 2 inh 5 dbnz 3 ix1 6 dbnz 4 sp1 4 dbnz 2ix 2 pshh 1 inh 2 sei 1 inh 2 add 2 imm 3 add 2 dir 4 add 3 ext 4 add 3 ix2 5 add 4 sp2 3 add 2 ix1 4 add 3 sp1 2 add 1ix c 5 brset6 3 dir 4 bset6 2 dir 3 bmc 2 rel 4 inc 2 dir 1 inca 1 inh 1 incx 1 inh 4 inc 2 ix1 5 inc 3 sp1 3 inc 1ix 1 clrh 1 inh 1 rsp 1 inh 2 jmp 2 dir 3 jmp 3 ext 4 jmp 3 ix2 3 jmp 2 ix1 2 jmp 1ix d 5 brclr6 3 dir 4 bclr6 2 dir 3 bms 2 rel 3 tst 2 dir 1 tsta 1 inh 1 tstx 1 inh 3 tst 2 ix1 4 tst 3 sp1 2 tst 1ix 1 nop 1 inh 4 bsr 2 rel 4 jsr 2 dir 5 jsr 3 ext 6 jsr 3 ix2 5 jsr 2 ix1 4 jsr 1ix e 5 brset7 3 dir 4 bset7 2 dir 3 bil 2 rel 5 mov 3dd 4 mov 2 dix+ 4 mov 3 imd 4 mov 2 ix+d 1 stop 1 inh * 2 ldx 2 imm 3 ldx 2 dir 4 ldx 3 ext 4 ldx 3 ix2 5 ldx 4 sp2 3 ldx 2 ix1 4 ldx 3 sp1 2 ldx 1ix f 5 brclr7 3 dir 4 bclr7 2 dir 3 bih 2 rel 3 clr 2 dir 1 clra 1 inh 1 clrx 1 inh 3 clr 2 ix1 4 clr 3 sp1 2 clr 1ix 1 wait 1 inh 1 txa 1 inh 2 aix 2 imm 3 stx 2 dir 4 stx 3 ext 4 stx 3 ix2 5 stx 4 sp2 3 stx 2 ix1 4 stx 3 sp1 2 stx 1ix inh inherent rel relative sp1 stack pointer, 8-bit offset imm immediate ix indexed, no offset sp2 stack pointer, 16-bit offset dir direct ix1 indexed, 8-bit offset ix+ indexed, no offset with ext extended ix2 indexed, 16-bit offset post increment dd direct-direct imd immediate-direct ix1+ indexed, 1-byte offset with ix+d indexed-direct dix+ direct-indexed post increment * pre-byte for stack pointer indexed instructions 0 high byte of opcode in hexadecimal low byte of opcode in hexadecimal 0 5 brset0 3 dir cycles opcode mnemonic number of bytes / addressing mode msb lsb msb lsb f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) technical data mc68HC08BD24 ? rev. 1.0 76 central processor unit (cpu) motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 77 technical data ?mc68HC08BD24 section 7. system integration module (sim) 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 7.3 sim bus clock control and generation . . . . . . . . . . . . . . . . . . 81 7.3.1 bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7.3.2 clock start-up from por . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7.3.3 clocks in stop mode and wait mode . . . . . . . . . . . . . . . . . . 81 7.4 reset and system initialization. . . . . . . . . . . . . . . . . . . . . . . . . 82 7.4.1 external pin reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7.4.2 active resets from internal sources . . . . . . . . . . . . . . . . . . 83 7.4.2.1 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7.4.2.2 computer operating properly (cop) reset . . . . . . . . . . 85 7.4.2.3 illegal opcode reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.4.2.4 illegal address reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.5 sim counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.5.1 sim counter during power-on reset . . . . . . . . . . . . . . . . . 86 7.5.2 sim counter during stop mode recovery . . . . . . . . . . . . . . 87 7.5.3 sim counter and reset states. . . . . . . . . . . . . . . . . . . . . . . 87 7.6 exception control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 7.6.1 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 7.6.1.1 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 7.6.1.2 swi instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 7.6.2 interrupt status registers. . . . . . . . . . . . . . . . . . . . . . . . . . . 91 7.6.2.1 interrupt status register 1 . . . . . . . . . . . . . . . . . . . . . . . . 93 7.6.2.2 interrupt status register 2 . . . . . . . . . . . . . . . . . . . . . . . . 93 7.6.3 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 7.6.4 break interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 7.6.5 status flag protection in break mode . . . . . . . . . . . . . . . . . 94 7.7 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 78 system integration module (sim) motorola 7.7.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 7.7.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 7.8 sim registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.8.1 sim break status register (sbsr) . . . . . . . . . . . . . . . . . . . 98 7.8.2 sim reset status register (srsr) . . . . . . . . . . . . . . . . . . . 99 7.8.3 sim break flag control register (sbfcr) . . . . . . . . . . . . 100 7.2 introduction this section describes the system integration module, which supports up to 16 external and/or internal interrupts. together with the cpu, the sim controls all mcu activities. a block diagram of the sim is shown in figure 7-1 . table 7-1 shows a summary of the sim i/o registers. the sim is a system state controller that coordinates cpu and exception timing. the sim is responsible for: bus clock generation and control for cpu and peripherals: stop/wait/reset/break entry and recovery internal clock control master reset control, including power-on reset (por) and cop timeout interrupt control: acknowledge timing arbitration control timing vector address generation cpu enable/disable timing modular architecture expandable to 128 interrupt sources f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) introduction mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 79 figure 7-1. sim block diagram stop/wait clock control clock generators por control reset pin control sim reset status register interrupt control and priority decode module stop module wait cpu stop (from cpu) cpu wait (from cpu) simoscen (to oscillator) oscout (from oscillator) internal clocks master reset control reset pin logic lvi (from lvi module) illegal opcode (from cpu) illegal address (from address map decoders) cop (from cop module) interrupt sources cpu interface reset control sim counter cop clock oscxclk (from oscillator) ? 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 80 system integration module (sim) motorola table 7-2 shows the internal signal names used in this section. table 7-1. sim i/o register summary addr. register name bit 7 654321 bit 0 $fe00 sim break status register (sbsr) read: rrrrrr sbsw r write: note reset: 00000000 $fe01 sim reset status register (srsr) read: por pin cop ilop ilad 0 0 0 write: por: 10000000 $fe03 sim break flag control register (sbfcr) read: bcfe rrrrrrr write: reset: 0 $fe04 interrupt status register 1 (int1) read: if6 if5 if4 if3 if2 if1 0 0 write: rrrrrrrr reset: 00000000 $fe05 interrupt status register 2 (int2) read: 0000 if10 if9 if8 if7 write: rrrrrrrr reset: 00000000 note: writing a logic 0 clears sbsw. = unimplemented r = reserved table 7-2. signal name conventions signal name description oscxclk buffered version of osc1 from the oscillator oscout the oscxclk frequency divided by two. this signal is again divided by two in the sim to generate the internal bus clocks. (bus clock = oscxclk divided by four) iab internal address bus idb internal data bus porrst signal from the power-on reset module to the sim irst internal reset signal r/w read/write signal f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) sim bus clock control and generation mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 81 7.3 sim bus clock control and generation the bus clock generator provides system clock signals for the cpu and peripherals on the mcu. the system clocks are generated from an incoming clock, oscout, as shown in figure 7-2 . figure 7-2. osc clock signals 7.3.1 bus timing in user mode, the internal bus frequency is the oscillator frequency (oscxclk) divided by four. 7.3.2 clock start-up from por when the power-on reset module generates a reset, the clocks to the cpu and peripherals are inactive and held in an inactive phase until after the 4096 oscxclk cycle por timeout has completed. the rst is driven low by the sim during this entire period. the ibus clocks start upon completion of the timeout. 7.3.3 clocks in stop mode and wait mode upon exit from stop mode (by an interrupt, break, or reset), the sim allows oscxclk to clock the sim counter. the cpu and peripheral clocks do not become active until after the stop delay timeout. this timeout is selectable as 4096 or 32 oscxclk cycles. (see 7.7.2 stop mode .) simoscen oscxclk from sim ?2 oscout osc1 osc2 ? 2 bus clock generators sim sim counter oscillator f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 82 system integration module (sim) motorola in wait mode, the cpu clocks are inactive. the sim also produces two sets of clocks for other modules. refer to the wait mode subsection of each module to see if the module is active or inactive in wait mode. some modules can be programmed to be active in wait mode. 7.4 reset and system initialization the mcu has the following reset sources: power-on reset module (por) external reset pin (rst ) computer operating properly module (cop) illegal opcode illegal address all of these resets produce the vector $fffe?fff ($fefe?eff in monitor mode) and assert the internal reset signal (irst). irst causes all registers to be returned to their default values and all modules to be returned to their reset states. an internal reset clears the sim counter (see 7.5 sim counter ), but an external reset does not. each of the resets sets a corresponding bit in the sim reset status register (srsr) (see 7.8 sim registers ). 7.4.1 external pin reset pulling the asynchronous rst pin low halts all processing. the pin bit of the sim reset status register (srsr) is set as long as rst is held low for a minimum of 67 oscxclk cycles, assuming that the por was the source of the reset (see table 7-3. pin bit set timing) . figure 7-3 shows the relative timing. table 7-3. pin bit set timing reset type number of cycles required to set pin por 4163 (4096 + 64 + 3) all others 67 (64 + 3) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) reset and system initialization mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 83 figure 7-3. external reset timing 7.4.2 active resets from internal sources sim module in hc08 has the capability to drive the rst pin low when internal reset events occur. all internal reset sources actively pull the rst pin low for 32 oscxclk cycles to allow resetting of external peripherals. the internal reset signal irst continues to be asserted for an additional 32 cycles (see figure 7- 4. internal reset timing) . an internal reset can be caused by an illegal address, illegal opcode, cop timeout, or por (see figure 7-5. sources of internal reset) . note that for por resets, the sim cycles through 4096 oscxclk cycles during which the sim forces the rst pin low. the internal reset signal then follows the sequence from the falling edge of rst shown in figure 7-4 . figure 7-4. internal reset timing the cop reset is asynchronous to the bus clock. rst iab pc vect h vect l oscout irst rst rst pulled low by mcu iab 32 cycles 32 cycles vector high oscxclk f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 84 system integration module (sim) motorola figure 7-5. sources of internal reset the active reset feature allows the part to issue a reset to peripherals and other chips within a system built around the mcu. 7.4.2.1 power-on reset when power is first applied to the mcu, the power-on reset module (por) generates a pulse to indicate that power-on has occurred. the external reset pin (rst ) is held low while the sim counter counts out 4096 oscxclk cycles. sixty-four oscxclk cycles later, the cpu and memories are released from reset to allow the reset vector sequence to occur. at power-on, the following events occur: a por pulse is generated. the internal reset signal is asserted. the sim enables the oscillator to drive oscxclk. internal clocks to the cpu and modules are held inactive for 4096 oscxclk cycles to allow stabilization of the oscillator. the rst pin is driven low during the oscillator stabilization time. the por bit of the sim reset status register (srsr) is set and all other bits in the register are cleared. illegal address rst illegal opcode rst coprst por internal reset f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) reset and system initialization mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 85 figure 7-6. por recovery 7.4.2.2 computer operating properly (cop) reset an input to the sim is reserved for the cop reset signal. the overflow of the cop counter causes an internal reset and sets the cop bit in the sim reset status register (srsr). the sim actively pulls down the rst pin for all internal reset sources. to prevent a cop module timeout, write any value to location $ffff. writing to location $ffff clears the cop counter and bits 12 through 5 of the sim counter. the sim counter output, which occurs at least every 2 12 ?2 4 oscxclk cycles, drives the cop counter. the cop should be serviced as soon as possible out of reset to guarantee the maximum amount of time before the first timeout. the cop module is disabled if the rst pin or the irq is held at v tst while the mcu is in monitor mode. the cop module can be disabled only through combinational logic conditioned with the high voltage signal on the rst pin or the irq pin. this prevents the cop from becoming disabled as a result of external noise. during a break state, v tst on the rst pin disables the cop module. porrst osc1 oscxclk oscout rst iab 4096 cycles 32 cycles 32 cycles $fffe $ffff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 86 system integration module (sim) motorola 7.4.2.3 illegal opcode reset the sim decodes signals from the cpu to detect illegal instructions. an illegal instruction sets the ilop bit in the sim reset status register (srsr) and causes a reset. if the stop enable bit, stop, in the configure register 1 (config1) is logic zero, the sim treats the stop instruction as an illegal opcode and causes an illegal opcode reset. the sim actively pulls down the rst pin for all internal reset sources. 7.4.2.4 illegal address reset an opcode fetch from an unmapped address generates an illegal address reset. the sim verifies that the cpu is fetching an opcode prior to asserting the ilad bit in the sim reset status register (srsr) and resetting the mcu. a data fetch from an unmapped address does not generate a reset. the sim actively pulls down the rst pin for all internal reset sources. 7.5 sim counter the sim counter is used by the power-on reset module (por) and in stop mode recovery to allow the oscillator time to stabilize before enabling the internal bus (ibus) clocks. the sim counter also serves as a prescaler for the computer operating properly module (cop). the sim counter overflow supplies the clock for the cop module. the sim counter is 12 bits long and is clocked by the falling edge of oscxclk. 7.5.1 sim counter during power-on reset the power-on reset module (por) detects power applied to the mcu. at power-on, the por circuit asserts the signal porrst. once the sim is initialized, it enables the oscillator to drive the bus clock state machine. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) exception control mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 87 7.5.2 sim counter during stop mode recovery the sim counter also is used for stop mode recovery. the stop instruction clears the sim counter. after an interrupt, break, or reset, the sim senses the state of the short stop recovery bit, ssrec, in the configure register 1 (config1). if the ssrec bit is a logic one, then the stop recovery is reduced from the normal delay of 4096 oscxclk cycles down to 32 oscxclk cycles. this is ideal for applications using canned oscillators that do not require long start-up times from stop mode. external crystal applications should use the full stop recovery time, that is, with ssrec cleared. 7.5.3 sim counter and reset states external reset has no effect on the sim counter (see 7.7.2 stop mode ). the sim counter is free-running after all reset states ( see 7.4.2 active resets from internal sources for counter control and internal reset recovery sequences). 7.6 exception control normally, sequential program execution can be changed in three different ways: interrupts maskable hardware cpu interrupts non-maskable software interrupt instruction (swi) reset break interrupts f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 88 system integration module (sim) motorola 7.6.1 interrupts an interrupt temporarily changes the sequence of program execution to respond to a particular event. figure 7-9 flow charts the handling of system interrupts. interrupts are latched, and arbitration is performed in the sim at the start of interrupt processing. the arbitration result is a constant that the cpu uses to determine which vector to fetch. once an interrupt is latched by the sim, no other interrupt can take precedence, regardless of priority, until the latched interrupt is serviced (or the i bit is cleared). at the beginning of an interrupt, the cpu saves the cpu register contents on the stack and sets the interrupt mask (i bit) to prevent additional interrupts. at the end of an interrupt, the rti instruction recovers the cpu register contents from the stack so that normal processing can resume. figure 7-7 shows interrupt entry timing. figure 7-8 shows interrupt recovery timing. figure 7-7 . interrupt entry figure 7-8. interrupt recovery module idb r/w interrupt dummy sp sp ?1 sp ?2 sp ?3 sp ?4 vect h vect l start addr iab dummy pc ?1[7:0] pc ?1[15:8] x a ccr v data h v data l opcode i bit module idb r/w interrupt sp ?4 sp ?3 sp ?2 sp ?1 sp pc pc + 1 iab ccr a x pc ?1[7:0] pc ?1[15:8] opcode operand i bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) exception control mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 89 figure 7-9. interrupt processing no no no yes no no yes no yes yes (as many interrupts as exist on chip) i bit set? from reset break interrupt? i bit set? irq interrupt? ddc12ab interrupt? swi instruction? rti instruction? fetch next instruction. unstack cpu registers. stack cpu registers. set i bit. load pc with interrupt vector. execute instruction. yes yes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 90 system integration module (sim) motorola interrupts are latched, and arbitration is performed in the sim at the start of interrupt processing. the arbitration result is a constant that the cpu uses to determine which vector to fetch. once an interrupt is latched by the sim, no other interrupt may take precedence, regardless of priority, until the latched interrupt is serviced (or the i bit is cleared). (see figure 7-9. interrupt processing .) 7.6.1.1 hardware interrupts a hardware interrupt does not stop the current instruction. processing of a hardware interrupt begins after completion of the current instruction. when the current instruction is complete, the sim checks all pending hardware interrupts. if interrupts are not masked (i bit clear in the condition code register), and if the corresponding interrupt enable bit is set, the sim proceeds with interrupt processing; otherwise, the next instruction is fetched and executed. if more than one interrupt is pending at the end of an instruction execution, the highest priority interrupt is serviced first. figure 7-10 demonstrates what happens when two interrupts are pending. if an interrupt is pending upon exit from the original interrupt service routine, the pending interrupt is serviced before the lda instruction is executed. figure 7-10 . interrupt recognition example cli lda int1 pulh rti int2 background routine #$ff pshh int1 interrupt service routine pulh rti pshh int2 interrupt service routine f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) exception control mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 91 the lda opcode is pre-fetched by both the int1 and int2 rti instructions. however, in the case of the int1 rti pre-fetch, this is a redundant operation. note: to maintain compatibility with the m6805 family, the h register is not pushed on the stack during interrupt entry. if the interrupt service routine modifies the h register or uses the indexed addressing mode, software should save the h register and then restore it prior to exiting the routine. 7.6.1.2 swi instruction the swi instruction is a non-maskable instruction that causes an interrupt regardless of the state of the interrupt mask (i bit) in the condition code register. note: a software interrupt pushes pc onto the stack. a software interrupt does not push pc ?1, as a hardware interrupt does. 7.6.2 interrupt status registers the flags in the interrupt status registers identify maskable interrupt sources. table 7-4 summarizes the interrupt sources and the interrupt status register flags that they set. the interrupt status registers can be useful for debugging. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 92 system integration module (sim) motorola table 7-4. interrupt sources source flag mask 1 int register flag priority 2 vector address reset none none none 0 $fffe?ffff swi instruction none none none 0 $fffc?fffd irq pin irqf imask if1 1 $fffa?fffb reserved 2 $fff8?fff9 ddc12ab alif dien if3 3 $fff6?fff7 nakif rxif txif sclif sclien reserved 4 $fff4?fff5 tim channel 0 ch0f ch0ie if5 5 $fff2?fff3 tim channel 1 ch1f ch1ie if6 6 $fff0?fff1 tim overflow tof toie if7 7 $ffee?ffef sync processor vsif vsie if8 8 $ffec?ffed lvsif lvsie reserved 9 $ffea?feb adc conversion complete coco aien if10 10 $ffe8?ffe9 reserved $ffe6?ffe7 1. the i bit in the condition code register is a global mask for all interrupts sources except the swi instruction. 2. 0 = highest priority f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) exception control mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 93 7.6.2.1 interrupt status register 1 if6?f1 ?interrupt flags 6? these flags indicate the presence of interrupt requests from the sources shown in table 7-4 . 1 = interrupt request present 0 = no interrupt request present bit 1and bit 0 ?always read 0 7.6.2.2 interrupt status register 2 if10?f7 ?interrupt flags 6? these flags indicate the presence of interrupt requests from the sources shown in table 7-4 . 1 = interrupt request present 0 = no interrupt request present bit 7 and bit 4 ?always read 0 address: $fe04 bit 7 654321 bit 0 read: if6 if5 if4 if3 if2 if1 0 0 write: rrrrrrrr reset: 00000000 r = reserved figure 7-11. interrupt status register 1 (int1) address: $fe05 bit 7 654321 bit 0 read: 0000 if10 if9 if8 if7 write: rrrrrrrr reset: 00000000 r = reserved figure 7-12. interrupt status register 2 (int2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 94 system integration module (sim) motorola 7.6.3 reset all reset sources always have equal and highest priority and cannot be arbitrated. 7.6.4 break interrupts the break module can stop normal program flow at a software- programmable break point by asserting its break interrupt output (see section 18. break module (brk) ). the sim puts the cpu into the break state by forcing it to the swi vector location. refer to the break interrupt subsection of each module to see how each module is affected by the break state. 7.6.5 status flag protection in break mode the sim controls whether status flags contained in other modules can be cleared during break mode. the user can select whether flags are protected from being cleared by properly initializing the break clear flag enable bit (bcfe) in the sim break flag control register (sbfcr). protecting flags in break mode ensures that set flags will not be cleared while in break mode. this protection allows registers to be freely read and written during break mode without losing status flag information. setting the bcfe bit enables the clearing mechanisms. once cleared in break mode, a flag remains cleared even when break mode is exited. status flags with a two-step clearing mechanism ?for example, a read of one register followed by the read or write of another ?are protected, even when the first step is accomplished prior to entering break mode. upon leaving break mode, execution of the second step will clear the flag as normal. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) low-power modes mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 95 7.7 low-power modes executing the wait or stop instruction puts the mcu in a low-power- consumption mode for standby situations. the sim holds the cpu in a non-clocked state. the operation of each of these modes is described below. both stop and wait clear the interrupt mask (i) in the condition code register, allowing interrupts to occur. 7.7.1 wait mode in wait mode, the cpu clocks are inactive while the peripheral clocks continue to run. figure 7-13 shows the timing for wait mode entry. a module that is active during wait mode can wake up the cpu with an interrupt if the interrupt is enabled. stacking for the interrupt begins one cycle after the wait instruction during which the interrupt occurred. in wait mode, the cpu clocks are inactive. refer to the wait mode subsection of each module to see if the module is active or inactive in wait mode. some modules can be programmed to be active in wait mode. wait mode can also be exited by a reset or break. a break interrupt during wait mode sets the sim break stop/wait bit, sbsw, in the sim break status register (sbsr). if the cop disable bit, copd, in configuration register 1 (config1) is logic zero, then the computer operating properly module (cop) is enabled and remains active in wait mode. figure 7-13. wait mode entry timing figure 7-14 and figure 7-15 show the timing for wait recovery. wait addr + 1 same same iab idb previous data next opcode same wait addr same r/w note: previous data can be operand data or the wait opcode, depending on the last instruction. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 96 system integration module (sim) motorola figure 7-14. wait recovery from interrupt or break figure 7-15. wait recovery from internal reset 7.7.2 stop mode in stop mode, the sim counter is reset and the system clocks are disabled. an interrupt request from a module can cause an exit from stop mode. stacking for interrupts begins after the selected stop recovery time has elapsed. reset or break also causes an exit from stop mode. the sim disables the oscillator signals (oscout and oscxclk) in stop mode, stopping the cpu and peripherals. stop recovery time is selectable using the ssrec bit in configuration register 1 (config1). if ssrec is set, stop recovery is reduced from the normal delay of 4096 oscxclk cycles down to 32. this is ideal for applications using canned oscillators that do not require long start-up times from stop mode. note: external crystal applications should use the full stop recovery time by clearing the ssrec bit. $6e0c $6e0b $00ff $00fe $00fd $00fc $a6 $a6 $01 $0b $6e $a6 iab idb exitstopwait note: exitstopwait = rst pin or cpu interrupt or break interrupt iab idb rst $a6 $a6 $6e0b rst vct h rst vct l $a6 oscxclk 32 cycles 32 cycles f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) low-power modes mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 97 a break interrupt during stop mode sets the sim break stop/wait bit (sbsw) in the sim break status register (sbsr). the sim counter is held in reset from the execution of the stop instruction until the beginning of stop recovery. it is then used to time the recovery period. figure 7-16 shows stop mode entry timing. figure 7-16. stop mode entry timing figure 7-17. stop mode recovery from interrupt or break stop addr + 1 same same iab idb previous data next opcode same stop addr same r/w cpustop note: previous data can be operand data or the stop opcode, depending on the last instruction. oscxclk int/break iab stop + 2 stop + 2 sp sp ?1 sp ?2 sp ?3 stop +1 stop recovery period f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 98 system integration module (sim) motorola 7.8 sim registers the sim has three memory mapped registers. table 7-5 shows the mapping of these registers. 7.8.1 sim break status register (sbsr) the sim break status register contains a flag to indicate that a break caused an exit from stop or wait mode. sbsw ?sim break stop/wait bit this status bit is useful in applications requiring a return to wait or stop mode after exiting from a break interrupt. clear sbsw by writing a logic 0 to it. reset clears sbsw. 1 = stop mode or wait mode was exited by break interrupt 0 = stop mode or wait mode was not exited by break interrupt table 7-5. sim registers summary address register access mode $fe00 sbsr user $fe01 srsr user $fe03 sbfcr user address: $fe00 bit 7 654321 bit 0 read: rrrrrr sbsw r write: note reset: 00000000 note: writing a logic 0 clears sbsw. r = reserved figure 7-18. sim break status register (sbsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) sim registers mc68HC08BD24 ? rev. 1.0 technical data motorola system integration module (sim) 99 sbsw can be read within the break interrupt routine. the user can modify the return address on the stack by subtracting one from it. the following code is an example. 7.8.2 sim reset status register (srsr) this register contains six flags that show the source of the last reset. clear the sim reset status register by reading it. a power-on reset sets the por bit and clears all other bits in the register. por ?power-on reset bit 1 = last reset caused by por circuit 0 = read of srsr ; ; ; this code works if the h register has been pushed onto the stack in the break service routine software. this code should be executed at the end of the break service routine software. hibyte equ 5 lobyte equ 6 ; if not sbsw, do rti brclr sbsw,sbsr, return ; ; see if wait mode or stop mode was exited by break. tst lobyte,sp ;if returnlo is not zero, bne dolo ;then just decrement low byte. dec hibyte,sp ;else deal with high byte, too. dolo dec lobyte,sp ;point to wait/stop opcode. return pulh rti ;restore h register. address: $fe01 bit 7 654321 bit 0 read: por pin cop ilop ilad 0 0 0 write: por: 10000000 = unimplemented figure 7-19. sim reset status register (srsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system integration module (sim) technical data mc68HC08BD24 ? rev. 1.0 100 system integration module (sim) motorola pin ?external reset bit 1 = last reset caused by external reset pin (rst ) 0 = por or read of srsr cop ?computer operating properly reset bit 1 = last reset caused by cop counter 0 = por or read of srsr ilop ?illegal opcode reset bit 1 = last reset caused by an illegal opcode 0 = por or read of srsr ilad ?illegal address reset bit (opcode fetches only) 1 = last reset caused by an opcode fetch from an illegal address 0 = por or read of srsr 7.8.3 sim break flag control register (sbfcr) the sim break flag control register contains a bit that enables software to clear status bits while the mcu is in a break state. bcfe ?break clear flag enable bit this read/write bit enables software to clear status bits by accessing status registers while the mcu is in a break state. to clear status bits during the break state, the bcfe bit must be set. 1 = status bits clearable during break 0 = status bits not clearable during break address: $fe03 bit 7 654321 bit 0 read: bcfe rrrrrrr write: reset: 0 r = reserved figure 7-20. sim break flag control register (sbfcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola oscillator (osc) 101 technical data ?mc68HC08BD24 section 8. oscillator (osc) 8.1 contents 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 8.3 oscillator external connections . . . . . . . . . . . . . . . . . . . . . . . 102 8.4 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 8.4.1 crystal amplifier input pin (osc1). . . . . . . . . . . . . . . . . . . 103 8.4.2 crystal amplifier output pin (osc2) . . . . . . . . . . . . . . . . . 103 8.4.3 oscillator enable signal (simoscen). . . . . . . . . . . . . . . . 103 8.4.4 external clock source (oscxclk) . . . . . . . . . . . . . . . . . . 103 8.4.5 oscillator out (oscout). . . . . . . . . . . . . . . . . . . . . . . . . . 103 8.5 low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 8.5.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 8.5.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 8.6 oscillator during break mode. . . . . . . . . . . . . . . . . . . . . . . . . 104 8.2 introduction the oscillator circuit is designed for use with crystals or ceramic resonators. the oscillator circuit generates the crystal clock signal, oscxclk, at the frequency of the crystal. this signal is divided by two before being passed on to the sim for bus clock generation. figure 8-1 shows the structure of the oscillator. the oscillator requires various external components. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
oscillator (osc) technical data mc68HC08BD24 ? rev. 1.0 102 oscillator (osc) motorola 8.3 oscillator external connections in its typical configuration, the oscillator requires five external components. the crystal oscillator is normally connected in a pierce oscillator configuration, as shown in figure 8-1 . this figure shows only the logical representation of the internal components and may not represent actual circuitry. the oscillator configuration uses five components: crystal, x 1 fixed capacitor, c 1 tuning capacitor, c 2 (can also be a fixed capacitor) feedback resistor, r b series resistor, r s (optional) the series resistor (r s ) is included in the diagram to follow strict pierce oscillator guidelines and may not be required for all ranges of operation, especially with high frequency crystals. refer to the crystal manufacturer? data for more information. figure 8-1. oscillator external connections c 1 c 2 simoscen oscxclk r b x 1 r s * *r s can be zero (shorted) when used with mcu from sim ?2 oscout to sim to sim osc1 osc2 higher-frequency crystals. refer to manufacturer? data. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
oscillator (osc) i/o signals mc68HC08BD24 ? rev. 1.0 technical data motorola oscillator (osc) 103 8.4 i/o signals the following paragraphs describe the oscillator i/o signals. 8.4.1 crystal amplifier input pin (osc1) the osc1 pin is an input to the crystal oscillator amplifier. an externally generated clock can also feed the osc1 pin of the crystal oscillator circuit. connect the external clock to the osc1 pin and let the osc2 pin float. the osc1 pin is rated at 3.3v. 8.4.2 crystal amplifier output pin (osc2) the osc2 pin is the output of the crystal oscillator inverting amplifier. the osc2 is rated at 3.3v. 8.4.3 oscillator enable signal (simoscen) the simoscen signal comes from the sim and enables the oscillator. 8.4.4 external clock source (oscxclk) oscxclk is the crystal oscillator output signal. it runs at the full speed of the crystal (f xclk ) and comes directly from the crystal oscillator circuit. figure 8-1 shows only the logical relation of oscxclk to osc1 and osc2 and may not represent the actual circuitry. the duty cycle of oscxclk is unknown and may depend on the crystal and other external factors. also, the frequency and amplitude of oscxclk can be unstable at start-up. 8.4.5 oscillator out (oscout) the clock driven to the sim is the crystal frequency divided by two. this signal is driven to the sim for generation of the bus clocks used by the cpu and other modules on the mcu. oscout will be divided again in the sim and results in the internal bus frequency being one fourth of the oscxclk frequency. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
oscillator (osc) technical data mc68HC08BD24 ? rev. 1.0 104 oscillator (osc) motorola 8.5 low power modes the wait and stop instructions put the mcu in low-power- consumption standby modes. 8.5.1 wait mode the wait instruction has no effect on the oscillator logic. oscxclk continues to drive to the sim module. 8.5.2 stop mode the stop instruction disables the oscxclk output. 8.6 oscillator during break mode the oscillator continues drive oscxclk when the chip enters the break state. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola monitor rom (mon) 105 technical data ?mc68HC08BD24 section 9. monitor rom (mon) 9.1 contents 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 9.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 9.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 9.4.1 entering monitor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 9.4.2 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 9.4.3 echoing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 9.4.4 break signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 9.4.5 commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 9.4.6 baud rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 9.2 introduction this section describes the monitor rom. the monitor rom allows complete testing of the mcu through a single-wire interface with a host computer. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
monitor rom (mon) technical data mc68HC08BD24 ? rev. 1.0 106 monitor rom (mon) motorola 9.3 features features of the monitor rom include: normal user-mode pin functionality one pin dedicated to serial communication between monitor rom and host computer standard mark/space non-return-to-zero (nrz) communication with host computer 9600 baud communication with host computer execution of code in ram 9.4 functional description the monitor rom receives and executes commands from a host computer. figure 9-1 shows a sample circuit used to enter monitor mode and communicate with a host computer via a standard rs-232 interface. simple monitor commands can access any memory address. in monitor mode, the mcu can execute host-computer code in ram while all mcu pins retain normal operating mode functions. all communication between the host computer and the mcu is through the pta0 pin. a level-shifting and multiplexing interface is required between pta0 and the host computer. pta0 is used in a wired-or configuration and requires a pull-up resistor. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
monitor rom (mon) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola monitor rom (mon) 107 figure 9-1. monitor mode circuit + + + + 10 m w x1 v dd v tst mc145407 mc74hc125 68hc08 rst irq osc1 osc2 v ss v dd pta0 v dd 10 k w 0.1 m f 10 w 6 5 2 4 3 1 db-25 2 3 7 20 18 17 19 16 15 v dd v dd v dd 20 pf 20 pf 10 m f 10 m f 10 m f 10 m f 1 2 4 7 14 3 0.1 m f 9.83 mhz 10 k w ptc3 v dd 10 k w b a notes: position b ?bus clock = oscxclk ? 2 (see notes) 5 6 ptc0 ptc1 v dd 10 k w position a ?bus clock = oscxclk ? 4 v ss1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
monitor rom (mon) technical data mc68HC08BD24 ? rev. 1.0 108 monitor rom (mon) motorola 9.4.1 entering monitor mode table 9-1 shows the pin conditions for entering monitor mode. note: holding the ptc3 pin low when entering monitor mode causes a bypass of a divide-by-two stage at the oscillator. the oscout frequency is equal to the oscxclk frequency, and the osc1 input directly generates internal bus clocks. in this case, the osc1 signal must have a 50% duty cycle at maximum bus frequency. enter monitor mode with the pin configuration shown above by pulling rst low and then high. the rising edge of rst latches monitor mode. once monitor mode is latched, the values on the specified pins can change. once out of reset, the mcu monitor mode firmware then sends a break signal (10 consecutive logic zeros) to the host computer, indicating that it is ready to receive a command. the break signal also provides a timing reference to allow the host to determine the necessary baud rate. monitor mode uses different vectors for reset and swi. the alternate vectors are in the $fe page instead of the $ff page and allow code execution from the internal monitor firmware instead of user code. when the host computer has completed downloading code into the mcu ram, this code can be executed by driving pta0 low while asserting rst low and then high. the internal monitor rom firmware will interpret the low on pta0 as an indication to jump to ram, and execution control will then continue from ram. execution of an swi from the downloaded code will return program control to the internal monitor rom firmware. table 9-1. mode selection irq pin ptc0 pin ptc1 pin pta0 pin ptc3 pin mode oscout bus frequency v tst 1011 monitor v tst 1010 monitor oscxclk oscxclk 2 ---------------------------- oscxclk 4 ---------------------------- oscxclk 2 ---------------------------- f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
monitor rom (mon) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola monitor rom (mon) 109 alternatively, the host can send a run command, which executes an rti, and this can be used to send control to the address on the stack pointer. the cop module is disabled in monitor mode as long as v tst is applied to the irq or the rst pin. (see section 7. system integration module (sim) for more information on modes of operation.) table 9-2 is a summary of the differences between user mode and monitor mode. 9.4.2 data format communication with the monitor rom is in standard non-return-to-zero (nrz) mark/space data format. (see figure 9-2 and figure 9-3 .) figure 9-2. monitor data format figure 9-3. sample monitor waveforms table 9-2. mode differences modes functions cop reset vector high reset vector low swi vector high swi vector low user enabled $fffe $ffff $fffc $fffd monitor disabled (1) notes : 1. if the high voltage (v tst ) is removed from the irq pin, the sim asserts its cop enable output. the cop is a mask option enabled or disabled by the copd bit in the configuration register. $fefe $feff $fefc $fefd bit 5 start bit bit 0 bit 1 next stop bit start bit bit 2 bit 3 bit 4 bit 6 bit 7 bit 5 start bit bit 0 bit 1 next stop bit start bit bit 2 bit 3 bit 4 bit 6 bit 7 start bit bit 0 bit 1 stop bit bit 2 $a5 break bit 3 bit 4 bit 5 bit 6 bit 7 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
monitor rom (mon) technical data mc68HC08BD24 ? rev. 1.0 110 monitor rom (mon) motorola the data transmit and receive rate can be anywhere from 4800 baud to 28.8 kbaud. transmit and receive baud rates must be identical. 9.4.3 echoing as shown in figure 9-4 , the monitor rom immediately echoes each received byte back to the pta0 pin for error checking. figure 9-4. read transaction any result of a command appears after the echo of the last byte of the command. 9.4.4 break signal a start bit followed by nine low bits is a break signal (see figure 9-5 ). when the monitor receives a break signal, it drives the pta0 pin high for the duration of two bits before echoing the break signal. figure 9-5. break transaction addr. high read read addr. high addr. low addr. low data echo sent to monitor result 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 missing stop bit two-stop-bit delay before zero echo f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
monitor rom (mon) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola monitor rom (mon) 111 9.4.5 commands the monitor rom uses the following commands: read (read memory) write (write memory) iread (indexed read) iwrite (indexed write) readsp (read stack pointer) run (run user program) table 9-3. read (read memory) command description read byte from memory operand specifies 2-byte address in high byte:low byte order data returned returns contents of specified address opcode $4a command sequence read read echo sent to monitor address high address high address low data return address low f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
monitor rom (mon) technical data mc68HC08BD24 ? rev. 1.0 112 monitor rom (mon) motorola table 9-4. write (write memory) command description write byte to memory operand specifics 2-byte address in high byte:low byte order; low byte followed by data byte data returned none opcode $49 command sequence table 9-5. iread (indexed read) command description read next 2 bytes in memory from last address accessed operand specifies 2-byte address in high byte:low byte order data returned returns contents of next two addresses opcode $1a command sequence write write echo sent to monitor address high address high address low address low data data iread iread echo sent to monitor data return data f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
monitor rom (mon) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola monitor rom (mon) 113 a sequence of iread or iwrite commands can sequentially access a block of memory over the full 64-kbyte memory map. table 9-6. iwrite (indexed write) command description write to last address accessed + 1 operand specifies single data byte data returned none opcode $19 command sequence table 9-7. readsp (read stack pointer) command description reads stack pointer operand none data returned returns stack pointer in high byte:low byte order opcode $0c command sequence iwrite iwrite echo sent to monitor data data readsp readsp echo sent to monitor sp return sp high low f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
monitor rom (mon) technical data mc68HC08BD24 ? rev. 1.0 114 monitor rom (mon) motorola 9.4.6 baud rate the communication baud rate is controlled by crystal frequency and the state of the ptc3 pin upon entry into monitor mode. when ptc3 is high, the divide by ratio is 1024. if the ptc3 pin is at logic zero upon entry into monitor mode, the divide by ratio is 512. table 9-8. run (run user program) command description executes rti instruction operand none data returned none opcode $28 command sequence run run echo sent to monitor table 9-9. monitor baud rate selection crystal frequency ptc3 pin baud rate 19.66 mhz 0 19200 bps 9.83 mhz 0 9600 bps 9.83 mhz 1 4800 bps f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 115 technical data ?mc68HC08BD24 section 10. timer interface module (tim) 10.1 contents 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 10.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 10.4 pin name conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 10.5 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 10.5.1 tim counter prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 10.5.2 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 10.5.3 output compare. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 10.5.3.1 unbuffered output compare . . . . . . . . . . . . . . . . . . . . . 120 10.5.3.2 buffered output compare . . . . . . . . . . . . . . . . . . . . . . . 121 10.5.4 pulse width modulation (pwm) . . . . . . . . . . . . . . . . . . . . . 121 10.5.4.1 unbuffered pwm signal generation . . . . . . . . . . . . . . . 122 10.5.4.2 buffered pwm signal generation . . . . . . . . . . . . . . . . . 123 10.5.4.3 pwm initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 10.6 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 10.7 wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 10.8 tim during break interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . 126 10.9 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 10.10 i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 10.10.1 tim status and control register (tsc) . . . . . . . . . . . . . . . 127 10.10.2 tim counter registers (tcnth:tcntl) . . . . . . . . . . . . . . 129 10.10.3 tim counter modulo registers (tmodh:tmodl) . . . . . . 130 10.10.4 tim channel status and control registers (tsc0:tsc1) . 131 10.10.5 tim channel registers (tch0h/l:tch1h/l) . . . . . . . . . . 135 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 116 timer interface module (tim) motorola 10.2 introduction this section describes the timer interface module (tim2, version b). the tim is a two-channel timer that provides a timing reference with input capture, output compare, and pulse-width-modulation functions. figure 10-1 is a block diagram of the tim. 10.3 features features of the tim include the following: two input capture/output compare channels rising-edge, falling-edge, or any-edge input capture trigger set, clear, or toggle output compare action buffered and unbuffered pulse width modulation (pwm) signal generation programmable tim clock input seven-frequency internal bus clock prescaler selection free-running or modulo up-count operation toggle any channel pin on overflow tim counter stop and reset bits modular architecture expandable to eight channels note: tch1 (timer channel 1) is not bonded to an external pin on this mcu. therefore, any references to the timer tch1 pin in the following text should be interpreted as not available ?but the internal status and control registers are still available. 10.4 pin name conventions the tim share one i/o pin with one port e i/o pin. the full name of the tim i/o pin is listed in table 10-1 . the generic pin name appear in the text that follows. table 10-1. pin name conventions tim generic pin names: tch0 tch1 full tim pin names: pte0/sog/tch0 not available f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 117 10.5 functional description figure 10-1 shows the structure of the tim. the central component of the tim is the 16-bit tim counter that can operate as a free-running counter or a modulo up-counter. the tim counter provides the timing reference for the input capture and output compare functions. the tim counter modulo registers, tmodh:tmodl, control the modulo value of the tim counter. software can read the tim counter value at any time without affecting the counting sequence. the two tim channels are programmable independently as input capture or output compare channels. figure 10-1. tim block diagram prescaler prescaler select 16-bit comparator ps2 ps1 ps0 16-bit comparator 16-bit latch tch0h:tch0l ms0a els0b els0a tof toie 16-bit comparator 16-bit latch tch1h:tch1l channel 0 channel 1 tmodh:tmodl trst tstop tov0 ch0ie ch0f els1b els1a tov1 ch1ie ch1max ch1f ch0max ms0b 16-bit counter internal bus ms1a internal bus clock tch1 tch0 interrupt logic port logic interrupt logic interrupt logic port logic (not available) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 118 timer interface module (tim) motorola table 10-2. tim i/o register summary addr. register name bit 7 654321 bit 0 $000a tim status and control register (tsc) read: tof toie tstop 00 ps2 ps1 ps0 write: 0 trst reset: 00100000 $000c tim counter register high (tcnth) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 00000000 $000d tim counter register low (tcntl) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 00000000 $000e tim counter modulo register high (tmodh) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 11111111 $000f tim counter modulo register low (tmodl) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 11111111 $0010 tim channel 0 status/control register (tsc0) read: ch0f ch0ie ms0b ms0a els0b els0a tov0 ch0max write: 0 reset: 00000000 $0011 tim channel 0 register high (tch0h) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: indeterminate after reset $0012 tim channel 0 register low (tch0l) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: indeterminate after reset $0013 tim channel 1 status/control register (tsc1) read: ch1f ch1ie 0 ms1a els1b els1a tov1 ch1max write: 0 reset: 00000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 119 10.5.1 tim counter prescaler the tim clock source can be one of the seven prescaler outputs. the prescaler generates seven clock rates from the internal bus clock. the prescaler select bits, ps[2:0], in the tim status and control register (tsc) select the tim clock source. 10.5.2 input capture with the input capture function, the tim can capture the time at which an external event occurs. when an active edge occurs on the pin of an input capture channel, the tim latches the contents of the tim counter into the tim channel registers, tchxh:tchxl. the polarity of the active edge is programmable. input captures can generate tim cpu interrupt requests. 10.5.3 output compare with the output compare function, the tim can generate a periodic pulse with a programmable polarity, duration, and frequency. when the counter reaches the value in the registers of an output compare channel, the tim can set, clear, or toggle the channel pin. output compares can generate tim cpu interrupt requests. $0014 tim channel 1 register high (tch1h) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: indeterminate after reset $0015 tim channel 1 register low (tch1l) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: indeterminate after reset = unimplemented f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 120 timer interface module (tim) motorola 10.5.3.1 unbuffered output compare any output compare channel can generate unbuffered output compare pulses as described in 10.5.3 output compare . the pulses are unbuffered because changing the output compare value requires writing the new value over the old value currently in the tim channel registers. an unsynchronized write to the tim channel registers to change an output compare value could cause incorrect operation for up to two counter overflow periods. for example, writing a new value before the counter reaches the old value but after the counter reaches the new value prevents any compare during that counter overflow period. also, using a tim overflow interrupt routine to write a new, smaller output compare value may cause the compare to be missed. the tim may pass the new value before it is written. use the following methods to synchronize unbuffered changes in the output compare value on channel x: when changing to a smaller value, enable channel x output compare interrupts and write the new value in the output compare interrupt routine. the output compare interrupt occurs at the end of the current output compare pulse. the interrupt routine has until the end of the counter overflow period to write the new value. when changing to a larger output compare value, enable channel x tim overflow interrupts and write the new value in the tim overflow interrupt routine. the tim overflow interrupt occurs at the end of the current counter overflow period. writing a larger value in an output compare interrupt routine (at the end of the current pulse) could cause two output compares to occur in the same counter overflow period. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 121 10.5.3.2 buffered output compare channels 0 and 1 can be linked to form a buffered output compare channel whose output appears on the tch0 pin. the tim channel registers of the linked pair alternately control the output. setting the ms0b bit in tim channel 0 status and control register (tsc0) links channel 0 and channel 1. the output compare value in the tim channel 0 registers initially controls the output on the tch0 pin. writing to the tim channel 1 registers enables the tim channel 1 registers to synchronously control the output after the tim overflows. at each subsequent overflow, the tim channel registers (0 or 1) that control the output are the ones written to last. tsc0 controls and monitors the buffered output compare function, and tim channel 1 status and control register (tsc1) is unused. while the ms0b bit is set, the channel 1 pin, tch1, is available as a general-purpose i/o pin. note: in buffered output compare operation, do not write new output compare values to the currently active channel registers. writing to the active channel registers is the same as generating unbuffered output compares. 10.5.4 pulse width modulation (pwm) by using the toggle-on-overflow feature with an output compare channel, the tim can generate a pwm signal. the value in the tim counter modulo registers determines the period of the pwm signal. the channel pin toggles when the counter reaches the value in the tim counter modulo registers. the time between overflows is the period of the pwm signal. as figure 10-2 shows, the output compare value in the tim channel registers determines the pulse width of the pwm signal. the time between overflow and output compare is the pulse width. program the tim to clear the channel pin on output compare if the state of the pwm pulse is logic one. program the tim to set the pin if the state of the pwm pulse is logic zero. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 122 timer interface module (tim) motorola figure 10-2. pwm period and pulse width the value in the tim counter modulo registers and the selected prescaler output determines the frequency of the pwm output. the frequency of an 8-bit pwm signal is variable in 256 increments. writing $00ff (255) to the tim counter modulo registers produces a pwm period of 256 times the internal bus clock period if the prescaler select value is 000 (see 10.10.1 tim status and control register (tsc) ). the value in the tim channel registers determines the pulse width of the pwm output. the pulse width of an 8-bit pwm signal is variable in 256 increments. writing $0080 (128) to the tim channel registers produces a duty cycle of 128/256 or 50%. 10.5.4.1 unbuffered pwm signal generation any output compare channel can generate unbuffered pwm pulses as described in 10.5.4 pulse width modulation (pwm) . the pulses are unbuffered because changing the pulse width requires writing the new pulse width value over the old value currently in the tim channel registers. an unsynchronized write to the tim channel registers to change a pulse width value could cause incorrect operation for up to two pwm periods. for example, writing a new value before the counter reaches the old value but after the counter reaches the new value prevents any compare during that pwm period. also, using a tim overflow interrupt routine to ptdx/tchx period pulse width overflow overflow overflow output compare output compare output compare f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 123 write a new, smaller pulse width value may cause the compare to be missed. the tim may pass the new value before it is written. use the following methods to synchronize unbuffered changes in the pwm pulse width on channel x: when changing to a shorter pulse width, enable channel x output compare interrupts and write the new value in the output compare interrupt routine. the output compare interrupt occurs at the end of the current pulse. the interrupt routine has until the end of the pwm period to write the new value. when changing to a longer pulse width, enable channel x tim overflow interrupts and write the new value in the tim overflow interrupt routine. the tim overflow interrupt occurs at the end of the current pwm period. writing a larger value in an output compare interrupt routine (at the end of the current pulse) could cause two output compares to occur in the same pwm period. note: in pwm signal generation, do not program the pwm channel to toggle on output compare. toggling on output compare prevents reliable 0% duty cycle generation and removes the ability of the channel to self- correct in the event of software error or noise. toggling on output compare also can cause incorrect pwm signal generation when changing the pwm pulse width to a new, much larger value. 10.5.4.2 buffered pwm signal generation channels 0 and 1 can be linked to form a buffered pwm channel whose output appears on the tch0 pin. the tim channel registers of the linked pair alternately control the pulse width of the output. setting the ms0b bit in tim channel 0 status and control register (tsc0) links channel 0 and channel 1. the tim channel 0 registers initially control the pulse width on the tch0 pin. writing to the tim channel 1 registers enables the tim channel 1 registers to synchronously control the pulse width at the beginning of the next pwm period. at each subsequent overflow, the tim channel registers (0 or 1) that control the pulse width are the ones written to last. tsc0 controls and monitors the buffered pwm function, and tim channel 1 status and control register f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 124 timer interface module (tim) motorola (tsc1) is unused. while the ms0b bit is set, the channel 1 pin, tch1, is available as a general-purpose i/o pin. note: in buffered pwm signal generation, do not write new pulse width values to the currently active channel registers. writing to the active channel registers is the same as generating unbuffered pwm signals. 10.5.4.3 pwm initialization to ensure correct operation when generating unbuffered or buffered pwm signals, use the following initialization procedure: 1. in the tim status and control register (tsc): a. stop the tim counter by setting the tim stop bit, tstop. b. reset the tim counter by setting the tim reset bit, trst. 2. in the tim counter modulo registers (tmodh:tmodl), write the value for the required pwm period. 3. in the tim channel x registers (tchxh:tchxl), write the value for the required pulse width. 4. in tim channel x status and control register (tscx): a. write 0:1 (for unbuffered output compare or pwm signals) or 1:0 (for buffered output compare or pwm signals) to the mode select bits, msxb:msxa. (see table 10-4 .) b. write 1 to the toggle-on-overflow bit, tovx. c. write 1:0 (to clear output on compare) or 1:1 (to set output on compare) to the edge/level select bits, elsxb:elsxa. the output action on compare must force the output to the complement of the pulse width level. (see table 10-4 .) note: in pwm signal generation, do not program the pwm channel to toggle on output compare. toggling on output compare prevents reliable 0% duty cycle generation and removes the ability of the channel to self- correct in the event of software error or noise. toggling on output compare can also cause incorrect pwm signal generation when changing the pwm pulse width to a new, much larger value. 5. in the tim status control register (tsc), clear the tim stop bit, tstop. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) interrupts mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 125 setting ms0b links channels 0 and 1 and configures them for buffered pwm operation. the tim channel 0 registers (tch0h:tch0l) initially control the buffered pwm output. tim status control register 0 (tscr0) controls and monitors the pwm signal from the linked channels. ms0b takes priority over ms0a. clearing the toggle-on-overflow bit, tovx, inhibits output toggles on tim overflows. subsequent output compares try to force the output to a state it is already in and have no effect. the result is a 0% duty cycle output. setting the channel x maximum duty cycle bit (chxmax) and clearing the tovx bit generates a 100% duty cycle output. see 10.10.4 tim channel status and control registers (tsc0:tsc1) . 10.6 interrupts the following tim sources can generate interrupt requests: tim overflow flag (tof) ?the tof bit is set when the tim counter value rolls over to $0000 after matching the value in the tim counter modulo registers. the tim overflow interrupt enable bit, toie, enables tim overflow cpu interrupt requests. tof and toie are in the tim status and control register. tim channel flags (ch1f:ch0f) ?the chxf bit is set when an input capture or output compare occurs on channel x. channel x tim cpu interrupt requests are controlled by the channel x interrupt enable bit, chxie. channel x tim cpu interrupt requests are enabled when chxie=1. chxf and chxie are in the tim channel x status and control register. 10.7 wait mode the wait instruction puts the mcu in low-power-consumption standby mode. the tim remains active after the execution of a wait instruction. in wait mode the tim registers are not accessible by the cpu. any enabled cpu interrupt request from the tim can bring the mcu out of wait mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 126 timer interface module (tim) motorola if tim functions are not required during wait mode, reduce power consumption by stopping the tim before executing the wait instruction. 10.8 tim during break interrupts a break interrupt stops the tim counter. the system integration module (sim) controls whether status bits in other modules can be cleared during the break state. the bcfe bit in the break flag control register (bfcr) enables software to clear status bits during the break state. (see 18.6.4 sim break flag control register .) to allow software to clear status bits during a break interrupt, write a logic one to the bcfe bit. if a status bit is cleared during the break state, it remains cleared when the mcu exits the break state. to protect status bits during the break state, write a logic zero to the bcfe bit. with bcfe at logic zero (its default state), software can read and write i/o registers during the break state without affecting status bits. some status bits have a two-step read/write clearing procedure. if software does the first step on such a bit before the break, the bit cannot change during the break state as long as bcfe is at logic zero. after the break, doing the second step clears the status bit. 10.9 i/o signals port e shares one of its pins with the tim. the tim channel i/o pin is pte0/sog/tch0. tch0 pin is programmable independently as an input capture pin or an output compare pin. it also can be configured as a buffered output compare or buffered pwm pin. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) i/o registers mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 127 10.10 i/o registers the following i/o registers control and monitor operation of the tim: tim status and control register (tsc) tim control registers (tcnth:tcntl) tim counter modulo registers (tmodh:tmodl) tim channel status and control registers (tsc0 and tsc1) tim channel registers (tch0h:tch0l and tch1h:tch1l) 10.10.1 tim status and control register (tsc) the tim status and control register does the following: enables tim overflow interrupts flags tim overflows stops the tim counter resets the tim counter prescales the tim counter clock tof ?tim overflow flag bit this read/write flag is set when the tim counter resets to $0000 after reaching the modulo value programmed in the tim counter modulo registers. clear tof by reading the tim status and control register when tof is set and then writing a logic zero to tof. if another tim address: $000a bit 7 654321 bit 0 read: tof toie tstop 00 ps2 ps1 ps0 write: 0 trst reset: 00100000 = unimplemented figure 10-3. tim status and control register (tsc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 128 timer interface module (tim) motorola overflow occurs before the clearing sequence is complete, then writing logic zero to tof has no effect. therefore, a tof interrupt request cannot be lost due to inadvertent clearing of tof. reset clears the tof bit. writing a logic one to tof has no effect. 1 = tim counter has reached modulo value 0 = tim counter has not reached modulo value toie ?tim overflow interrupt enable bit this read/write bit enables tim overflow interrupts when the tof bit becomes set. reset clears the toie bit. 1 = tim overflow interrupts enabled 0 = tim overflow interrupts disabled tstop ?tim stop bit this read/write bit stops the tim counter. counting resumes when tstop is cleared. reset sets the tstop bit, stopping the tim counter until software clears the tstop bit. 1 = tim counter stopped 0 = tim counter active note: do not set the tstop bit before entering wait mode if the tim is required to exit wait mode. trst ?tim reset bit setting this write-only bit resets the tim counter and the tim prescaler. setting trst has no effect on any other registers. counting resumes from $0000. trst is cleared automatically after the tim counter is reset and always reads as logic zero. reset clears the trst bit. 1 = prescaler and tim counter cleared 0 = no effect note: setting the tstop and trst bits simultaneously stops the tim counter at a value of $0000. ps[2:0] ?prescaler select bits these read/write bits select either the tclk pin or one of the seven prescaler outputs as the input to the tim counter as table 10-3 shows. reset clears the ps[2:0] bits. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) i/o registers mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 129 10.10.2 tim counter registers (tcnth:tcntl) the two read-only tim counter registers contain the high and low bytes of the value in the tim counter. reading the high byte (tcnth) latches the contents of the low byte (tcntl) into a buffer. subsequent reads of tcnth do not affect the latched tcntl value until tcntl is read. reset clears the tim counter registers. setting the tim reset bit (trst) also clears the tim counter registers. note: if you read tcnth during a break interrupt, be sure to unlatch tcntl by reading tcntl before exiting the break interrupt. otherwise, tcntl retains the value latched during the break. table 10-3. prescaler selection ps2 ps1 ps0 tim clock source 0 0 0 internal bus clock ?1 0 0 1 internal bus clock ?2 0 1 0 internal bus clock ?4 0 1 1 internal bus clock ?8 1 0 0 internal bus clock ?16 1 0 1 internal bus clock ?32 1 1 0 internal bus clock ?64 1 1 1 not available f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 130 timer interface module (tim) motorola 10.10.3 tim counter modulo registers (tmodh:tmodl) the read/write tim modulo registers contain the modulo value for the tim counter. when the tim counter reaches the modulo value, the overflow flag (tof) becomes set, and the tim counter resumes counting from $0000 at the next clock. writing to the high byte (tmodh) inhibits the tof bit and overflow interrupts until the low byte (tmodl) is written. reset sets the tim counter modulo registers. address: $000c tcnth bit 7 654321 bit 0 read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 00000000 address: $000d tcntl bit 7 654321 bit 0 read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 00000000 = unimplemented figure 10-4. tim counter registers (tcnth:tcntl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) i/o registers mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 131 note: reset the tim counter before writing to the tim counter modulo registers. 10.10.4 tim channel status and control registers (tsc0:tsc1) each of the tim channel status and control registers does the following: flags input captures and output compares enables input capture and output compare interrupts selects input capture, output compare, or pwm operation selects high, low, or toggling output on output compare selects rising edge, falling edge, or any edge as the active input capture trigger selects output toggling on tim overflow selects 100% pwm duty cycle selects buffered or unbuffered output compare/pwm operation address: $000e tmodh bit 7 654321 bit 0 read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 11111111 address: $000f tmodl bit 7 654321 bit 0 read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 11111111 figure 10-5. tim counter modulo registers (tmodh:tmodl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 132 timer interface module (tim) motorola chxf ?channel x flag bit when channel x is an input capture channel, this read/write bit is set when an active edge occurs on the channel x pin. when channel x is an output compare channel, chxf is set when the value in the tim counter registers matches the value in the tim channel x registers. when tim cpu interrupt requests are enabled (chxie=1), clear chxf by reading the tim channel x status and control register with chxf set and then writing a logic zero to chxf. if another interrupt request occurs before the clearing sequence is complete, then writing logic zero to chxf has no effect. therefore, an interrupt request cannot be lost due to inadvertent clearing of chxf. reset clears the chxf bit. writing a logic one to chxf has no effect. 1 = input capture or output compare on channel x 0 = no input capture or output compare on channel x chxie ?channel x interrupt enable bit this read/write bit enables tim cpu interrupt service requests on channel x. reset clears the chxie bit. 1 = channel x cpu interrupt requests enabled 0 = channel x cpu interrupt requests disabled address: $0010 tsc0 bit 7 654321 bit 0 read: ch0f ch0ie ms0b ms0a els0b els0a tov0 ch0max write: 0 reset: 00000000 address: $0013 tsc1 bit 7 654321 bit 0 read: ch1f ch1ie 0 ms1a els1b els1a tov1 ch1max write: 0 reset: 00000000 = unimplemented figure 10-6. tim channel status and control registers (tsc0:tsc1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) i/o registers mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 133 msxb ?mode select bit b this read/write bit selects buffered output compare/pwm operation. msxb exists only in the tim channel 0 status and control register. setting ms0b disables the channel 1 status and control register and reverts tch1 to general-purpose i/o. reset clears the msxb bit. 1 = buffered output compare/pwm operation enabled 0 = buffered output compare/pwm operation disabled msxa ?mode select bit a when elsxb:a 1 00, this read/write bit selects either input capture operation or unbuffered output compare/pwm operation. see table 10-4 . 1 = unbuffered output compare/pwm operation 0 = input capture operation when elsxb:a = 00, this read/write bit selects the initial output level of the tchx pin. (see table 10-4 .). reset clears the msxa bit. 1 = initial output level low 0 = initial output level high note: before changing a channel function by writing to the msxb or msxa bit, set the tstop and trst bits in the tim status and control register (tsc). elsxb and elsxa ?edge/level select bits when channel x is an input capture channel, these read/write bits control the active edge-sensing logic on channel x. when channel x is an output compare channel, elsxb and elsxa control the channel x output behavior when an output compare occurs. when elsxb and elsxa are both clear, channel x is not connected to an i/o port , and pin tchx is available as a general-purpose port i/o pin. table 10-4 shows how elsxb and elsxa work. reset clears the elsxb and elsxa bits. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 134 timer interface module (tim) motorola note: before enabling a tim channel register for input capture operation, make sure that the ptdx/tchx pin is stable for at least two bus clocks. tovx ?toggle-on-overflow bit when channel x is an output compare channel, this read/write bit controls the behavior of the channel x output when the tim counter overflows. when channel x is an input capture channel, tovx has no effect. reset clears the tovx bit. 1 = channel x pin toggles on tim counter overflow. 0 = channel x pin does not toggle on tim counter overflow. note: when tovx is set, a tim counter overflow takes precedence over a channel x output compare if both occur at the same time. chxmax ?channel x maximum duty cycle bit when the tovx bit is at logic zero, setting the chxmax bit forces the duty cycle of buffered and unbuffered pwm signals to 100%. as figure 10-7 shows, the chxmax bit takes effect in the cycle after it is set or cleared. the output stays at the 100% duty cycle level until the cycle after chxmax is cleared. table 10-4. mode, edge, and level selection msxb msxa elsxb elsxa mode configuration x0 0 0 output preset pin under port control; initial output level high x1 0 0 pin under port control; initial output level low 00 0 1 input capture capture on rising edge only 0 0 1 0 capture on falling edge only 0 0 1 1 capture on rising or falling edge 01 0 1 output compare or pwm toggle output on compare 0 1 1 0 clear output on compare 0 1 1 1 set output on compare 1 x 0 1 buffered output compare or buffered pwm toggle output on compare 1 x 1 0 clear output on compare 1 x 1 1 set output on compare f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) i/o registers mc68HC08BD24 ? rev. 1.0 technical data motorola timer interface module (tim) 135 figure 10-7. chxmax latency 10.10.5 tim channel registers (tch0h/l:tch1h/l) these read/write registers contain the captured tim counter value of the input capture function or the output compare value of the output compare function. the state of the tim channel registers after reset is unknown. in input capture mode (msxb:msxa = 0:0), reading the high byte of the tim channel x registers (tchxh) inhibits input captures until the low byte (tchxl) is read. in output compare mode (msxb:msxa 1 0:0), writing to the high byte of the tim channel x registers (tchxh) inhibits output compares until the low byte (tchxl) is written. output overflow ptdx/tchx period chxmax overflow overflow overflow overflow compare output compare output compare output compare f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timer interface module (tim) technical data mc68HC08BD24 ? rev. 1.0 136 timer interface module (tim) motorola address: $0011 tch0h bit 7 654321 bit 0 read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: indeterminate after reset address: $0012 tch0l bit 7 654321 bit 0 read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: indeterminate after reset address: $0014 tch1h bit 7 654321 bit 0 read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: indeterminate after reset address: $0015 tch1l bit 7 654321 bit 0 read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: indeterminate after reset figure 10-8. tim channel registers (tch0h/l:tch1h/l) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola pulse width modulator (pwm) 137 technical data ?mc68HC08BD24 section 11. pulse width modulator (pwm) 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 11.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 11.4 pwm registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 11.4.1 pwm data registers 0 to 15 (0pwm?5pwm). . . . . . . . . 140 11.4.2 pwm control registers 1 and 2 (pwmcr1:pwmcr2) . . 141 11.2 introduction sixteen 8-bit pwm channels are available on the mc68HC08BD24. channels 0 to 7 are shared with port-b i/o pins under the control of the pwm control register 1. channels 8 to 15 are shared with port-a i/o pins under the control of the pwm control register 2. 11.3 functional description each 8-bit pwm channel is composed of an 8-bit register which contains a 5-bit pwm in msb portion and a 3-bit binary rate multiplier (brm) in lsb portion. there are 16 pwm data registers as shown in table 11-1 . the value programmed in the 5-bit pwm portion will determine the pulse length of the output. the clock to the 5-bit pwm portion is the system clock, the repetition rate of the output is hence 187.5khz at 6mhz clock. the 3-bit brm will generate a number of narrow pulses which are equally distributed among an 8-pwm-cycle frame. the number of pulses generated is equal to the number programmed in the 3-bit brm portion. examples of the waveforms are shown in figure 11-3 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pulse width modulator (pwm) technical data mc68HC08BD24 ? rev. 1.0 138 pulse width modulator (pwm) motorola combining the 5-bit pwm together with the 3-bit brm, the average duty cycle at the output will be (m+n/8)/32, where m is the content of the 5-bit pwm portion, and n is the content of the 3-bit brm portion. using this mechanism, a true 8-bit resolution pwm type dac with reasonably high repetition rate can be obtained. the value of each pwm data register is continuously compared with the content of an internal counter to determine the state of each pwm channel output pin. double buffering is not used in this pwm design. table 11-1. pwm i/o register summary addr. register name bit 7 654321 bit 0 $0020 pwm0 data register (0pwm) read: 0pwm4 0pwm3 0pwm2 0pwm1 0pwm0 0brm2 0brm1 0brm0 write: $0021 pwm1 data register (1pwm) read: 1pwm4 1pwm3 1pwm2 1pwm1 1pwm0 1brm2 1brm1 1brm0 write: $0022 pwm2 data register (2pwm) read: 2pwm4 2pwm3 2pwm2 2pwm1 2pwm0 2brm2 2brm1 2brm0 write: $0023 pwm3 data register (3pwm) read: 3pwm4 3pwm3 3pwm2 3pwm1 3pwm0 3brm2 3brm1 3brm0 write: $0024 pwm4 data register (4pwm) read: 4pwm4 4pwm3 4pwm2 4pwm1 4pwm0 4brm2 4brm1 4brm0 write: $0025 pwm5 data register (5pwm) read: 5pwm4 5pwm3 5pwm2 5pwm1 5pwm0 5brm2 5brm1 5brm0 write: $0026 pwm6 data register (6pwm) read: 6pwm4 6pwm3 6pwm2 6pwm1 6pwm0 6brm2 6brm1 6brm0 write: $0027 pwm7 data register (7pwm) read: 7pwm4 7pwm3 7pwm2 7pwm1 7pwm0 7brm2 7brm1 7brm0 write: $0028 pwm control register 1 (pwmcr1) read: pwm7e pwm6e pwm5e pwm4e pwm3e pwm2e pwm1e pwm0e write: reset: 00000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pulse width modulator (pwm) pwm registers mc68HC08BD24 ? rev. 1.0 technical data motorola pulse width modulator (pwm) 139 11.4 pwm registers the pwm module uses of 18 registers for data and control functions. 16 pwm data registers ($0020?0027 and $0051?0058) 2 pwm control registers ($0028 and $0059) $0051 pwm8 data register (8pwm) read: 8pwm4 8pwm3 8pwm2 8pwm1 8pwm0 8brm2 8brm1 8brm0 write: $0052 pwm9 data register (9pwm) read: 9pwm4 9pwm3 9pwm2 9pwm1 9pwm0 9brm2 9brm1 9brm0 write: $0053 pwm10 data register (10pwm) read: 10pwm4 10pwm3 10pwm2 10pwm1 10pwm0 10brm2 10brm1 10brm0 write: $0054 pwm11 data register (11pwm) read: 11pwm4 11pwm3 11pwm2 11pwm1 11pwm0 11brm2 11brm1 11brm0 write: $0055 pwm12 data register (12pwm) read: 12pwm4 12pwm3 12pwm2 12pwm1 12pwm0 12brm2 12brm1 12brm0 write: $0056 pwm13 data register (13pwm) read: 13pwm4 13pwm3 13pwm2 13pwm1 13pwm0 13brm2 13brm1 13brm0 write: $0057 pwm14 data register (14pwm) read: 14pwm4 pwm3 14pwm2 14pwm1 14pwm0 14brm2 14brm1 14brm0 write: $0058 pwm15 data register (15pwm) read: 15pwm4 15pwm3 15pwm2 15pwm1 15pwm0 15brm2 15brm1 15brm0 write: $0059 pwm control register 2 (pwmcr2) read: pwm15e pwm14e pwm13e pwm12e pwm11e pwm10e pwm9e pwm8e write: table 11-1. pwm i/o register summary reset: 00000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pulse width modulator (pwm) technical data mc68HC08BD24 ? rev. 1.0 140 pulse width modulator (pwm) motorola 11.4.1 pwm data registers 0 to 15 (0pwm?5pwm) the output waveform of the 16 pwm channels are each configured by an 8-bit register, which contains a 5-bit pwm in msb portion and a 3-bit binary rate multiplier (brm) in lsb portion xpwm4?pwm0 ?pwm bits the value programmed in the 5-bit pwm portion will determine the pulse length of the output. the clock to the 5-bit pwm portion is the system clock (cpu clock), the repetition rate of the output is hence f op ?32. examples of pwm output waveforms are shown in figure 11-3 . xbrm2?brm0 ?binary rate multiplier bits the 3-bit brm will generate a number of narrow pulses which are equally distributed among an 8-pwm-cycle frame. the number of pulses generated is equal to the number programmed in the 3-bit brm portion. examples of pwm output waveforms are shown in figure 11-3 . address: $0020?0027 and $0051?0058 bit 7 654321 bit 0 read: xpwm4 xpwm3 xpwm2 xpwm1 xpwm0 xbrm2 xbrm1 xbrm0 write: reset: 00000000 figure 11-1. pwm data registers 0 to 15 (0pwm?5pwm) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pulse width modulator (pwm) pwm registers mc68HC08BD24 ? rev. 1.0 technical data motorola pulse width modulator (pwm) 141 11.4.2 pwm control registers 1 and 2 (pwmcr1:pwmcr2) pwm15e?wm0e ?pwm output enable setting a bit to 1 will enable the corresponding pwm channel to use as pwm output. a zero configures the corresponding pwm pin as a standard i/o port pin. reset clears these bits. 1 = port pin configured as pwm output 0 = port pin configured as standard i/o port pin. $0028 pwm control register 1 (pwmcr1) read: pwm7e pwm6e pwm5e pwm4e pwm3e pwm2e pwm1e pwm0e write: $0059 pwm control register 2 (pwmcr2) read: pwm15e pwm14e pwm13e pwm12e pwm11e pwm10e pwm9e pwm8e write: reset: 00000000 figure 11-2. pwm control register 1 and 2 (pwmcr1:pwmcr2) table 11-2. pwm channels and port i/o pins port pin pwm channel control bit port pin pwm channel control bit ptb0 pwm0 pwm0e pta0 pwm8 pwm8e ptb1 pwm1 pwm1e pta1 pwm9 pwm9e ptb2 pwm2 pwm2e pta2 pwm10 pwm10e ptb3 pwm3 pwm3e pta3 pwm11 pwm11e ptb4 pwm4 pwm4e pta4 pwm12 pwm12e ptb5 pwm5 pwm5e pta5 pwm13 pwm13e ptb6 pwm6 pwm6e pta6 pwm14 pwm14e ptb7 pwm7 pwm7e pta7 pwm15 pwm15e f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pulse width modulator (pwm) technical data mc68HC08BD24 ? rev. 1.0 142 pulse width modulator (pwm) motorola figure 11-3. 8-bit pwm output waveforms m = $00 1 pwm cycle = 32 t m = $01 m = $0f m = $1f t = 1 cpu clock period (0.167 m s if cpu cloc k = 6 mhz) pulse inserted at end of pwm cycle n pwm cycles where pulses are inserted in a 8-cycle frame number of inserted pulses in a 8-cycle frame xx1 4 1 x1x 2, 6 2 1xx 1, 3, 5, 7 4 31 t 16 t 16 t 31 t t m = value set in 5-bit pwm (bit3-bit7) n = value set in 3-bit brm (bit0-bit2) t depends on setting of n. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola analog-to-digital converter (adc) 143 technical data ?mc68HC08BD24 section 12. analog-to-digital converter (adc) 12.1 contents 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 12.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 12.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 12.4.1 adc port i/o pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 12.4.2 voltage conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 12.4.3 conversion time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 12.4.4 continuous conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 12.4.5 accuracy and precision . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.5 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.6 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.6.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.6.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.7 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.7.1 adc voltage in (adcvin) . . . . . . . . . . . . . . . . . . . . . . . . . 148 12.8 i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 12.8.1 adc status and control register. . . . . . . . . . . . . . . . . . . . 148 12.8.2 adc data register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 12.8.3 adc input clock register . . . . . . . . . . . . . . . . . . . . . . . . . 151 12.2 introduction this section describes the analog-to-digital converter (adc). the adc is an 8-bit 6-channels analog-to-digital converter. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter (adc) technical data mc68HC08BD24 ? rev. 1.0 144 analog-to-digital converter (adc) motorola 12.3 features features of the adc module include: 6 channels adc with multiplexed input linear successive approximation 8-bit resolution single or continuous conversion conversion complete flag or conversion complete interrupt selectable adc clock 12.4 functional description four adc channels are available for sampling external sources at pins ptc5?tc0. an analog multiplexer allows the single adc converter to select one of the 6 adc channels as adc voltage input (adcvin). adcvin is converted by the successive approximation register-based counters. the adc resolution is 8 bits. when the conversion is completed, adc puts the result in the adc data register and sets a flag or generates an interrupt. figure 12-1 shows a block diagram of the adc. table 12-1. adc register summary addr. register name bit 7 654321 bit 0 $005d adc status and control register (adscr) read: coco aien adco adch4 adch3 adch2 adch1 adch0 write: reset: 00011111 $005e adc data register (adr) read: ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 write: reset: indeterminate after reset $005f adc input clock register (adiclk) read: adiv2 adiv1 adiv0 00000 write: reset: 00000000 = unimplemented f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter (adc) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola analog-to-digital converter (adc) 145 figure 12-1. adc block diagram 12.4.1 adc port i/o pins ptc5?tc0 are general-purpose i/o pins that are shared with the adc channels. the channel select bits (adc status control register, $005d), define which adc channel/port pin will be used as the input signal. the adc overrides the port i/o logic by forcing that pin as input to the adc. the remaining adc channels/port pins are controlled by the port i/o logic and can be used as general-purpose i/o. writes to the port register internal data b u s interrupt logic channel select adc clock generator conversion complete adc voltage in adcvin adc clock bus clock adch[4:0] adc data register adiv[2:0] adiclk aien coco disable disable adc channel x read ddrc write ddrc reset write ptc read ptc ptcx/adcx ddrcx ptcx (1 of 6 channels) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter (adc) technical data mc68HC08BD24 ? rev. 1.0 146 analog-to-digital converter (adc) motorola or ddr will not have any affect on the port pin that is selected by the adc. read of a port pin which is in use by the adc will return an unknown state if the corresponding ddr bit is at logic 0. if the ddr bit is at logic 1, the value in the port data latch is read. 12.4.2 voltage conversion when the input voltage to the adc equals v dd , the adc converts the signal to $ff (full scale). if the input voltage equals v ss , the adc converts it to $00. input voltage between v dd and v ss are a straight-line linear conversion. all other input voltages will result in $ff if greater than v dd and $00 if less than v ss . note: input voltage should not exceed the analog supply voltages. 12.4.3 conversion time twelve adc internal clocks are required to perform one conversion. the adc starts a conversion on the first rising edge of the adc internal clock immediately following a write to the adscr. if the adc internal clock is selected to run at 1mhz, then one conversion will take 12 m s to complete. with a 1mhz adc internal clock the maximum sample rate is 83.3khz. 12.4.4 continuous conversion in the continuous conversion mode, the adc continuously converts the selected channel filling the adc data register with new data after each conversion. data from the previous conversion will be overwritten whether that data has been read or not. conversions will continue until the adco bit is cleared. the coco bit (adc status control register, $005d) is set after each conversion and can be cleared by writing the adc status and control register or reading of the adc data register. 2 3 ------ - 2 3 ------ - 2 3 ------ - 12 adc clock cycles conversion time = adc clock frequency number of bus cycles = conversion time bus frequency f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter (adc) interrupts mc68HC08BD24 ? rev. 1.0 technical data motorola analog-to-digital converter (adc) 147 12.4.5 accuracy and precision the conversion process is monotonic and has no missing codes. 12.5 interrupts when the aien bit is set, the adc module is capable of generating a cpu interrupt after each adc conversion. a cpu interrupt is generated if the coco bit is at logic 0. the coco bit is not used as a conversion complete flag when interrupts are enabled. 12.6 low-power modes the following subsections describe the low-power modes. 12.6.1 wait mode the adc continues normal operation during wait mode. any enabled cpu interrupt request from the adc can bring the mcu out of wait mode. if the adc is not required to bring the mcu out of wait mode, power down the adc by setting the adch[4:0] bits in the adc status and control register to logic 1? before executing the wait instruction. 12.6.2 stop mode the adc module is inactive after the execution of a stop instruction. any pending conversion is aborted. adc conversions resume when the mcu exits stop mode. allow one conversion cycle to stabilize the analog circuitry before attempting a new adc conversion after exiting stop mode. 12.7 i/o signals the adc module has 6 channels that are shared with i/o port c. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter (adc) technical data mc68HC08BD24 ? rev. 1.0 148 analog-to-digital converter (adc) motorola 12.7.1 adc voltage in (adcvin) adcvin is the input voltage signal from one of the 6 adc channels to the adc module. 12.8 i/o registers three i/o registers control and monitor adc operation: adc status and control register (adscr, $005d) adc data register (adr, $005e) adc clock register (adiclk, $005f) 12.8.1 adc status and control register the following paragraphs describe the function of the adc status and control register. coco ?conversions complete bit when the aien bit is a logic 0, the coco is a read-only bit which is set each time a conversion is completed. this bit is cleared whenever the adc status and control register is written or whenever the adc data register is read. reset clears this bit. 1 = conversion completed (aien = 0) 0 = conversion not completed (aien = 0) when the aien bit is a logic 1 (cpu interrupt enabled), the coco is a read-only bit, and will always be logic 0 when read. address: $005d bit 7 654321 bit 0 read: coco aien adco adch4 adch3 adch2 adch1 adch0 write: reset: 00011111 = unimplemented figure 12-2. adc status and control register (adscr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter (adc) i/o registers mc68HC08BD24 ? rev. 1.0 technical data motorola analog-to-digital converter (adc) 149 aien ?adc interrupt enable bit when this bit is set, an interrupt is generated at the end of an adc conversion. the interrupt signal is cleared when the data register is read or the status/control register is written. reset clears the aien bit. 1 = adc interrupt enabled 0 = adc interrupt disabled adco ?adc continuous conversion bit when set, the adc will convert samples continuously and update the adr register at the end of each conversion. only one conversion is allowed when this bit is cleared. reset clears the adco bit. 1 = continuous adc conversion 0 = one adc conversion adch[4:0] ?adc channel select bits adch[4:0] form a 5-bit field which is used to select one of the adc channels. the five channel select bits are detailed in the following table. care should be taken when using a port pin as both an analog and a digital input simultaneously to prevent switching noise from corrupting the analog signal. (see table 12-2 .) the adc subsystem is turned off when the channel select bits are all set to one. this feature allows for reduced power consumption for the mcu when the adc is not used. reset sets all of these bits to a logic 1. note: recovery from the disabled state requires one conversion cycle to stabilize. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter (adc) technical data mc68HC08BD24 ? rev. 1.0 150 analog-to-digital converter (adc) motorola 12.8.2 adc data register one 8-bit result register is provided. this register is updated each time an adc conversion completes. table 12-2. mux channel select adch4 adch3 adch2 adch1 adch0 adc channel input select 00000 adc0 ptc0 00001 adc1 ptc1 00010 adc2 ptc2 00011 adc3 ptc3 00100 adc4 ptc4 00101 adc5 ptc5 00110 unused (see note 1) ::::: 11010 11011 reserved 11 1 0 0 unused 11 1 0 1 v dda (see note 2) 11 1 1 0 v ssa (see note 2) 11 1 1 1 adc power off notes: 1. if any unused channels are selected, the resulting adc conversion will be unknown. 2. the voltage levels supplied from internal reference nodes as specified in the table are used to verify the operation of the adc converter both in production test and for user applications. address: $005e bit 7 654321 bit 0 read: ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 write: reset: indeterminate after reset = unimplemented figure 12-3. adc data register (adr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter (adc) i/o registers mc68HC08BD24 ? rev. 1.0 technical data motorola analog-to-digital converter (adc) 151 12.8.3 adc input clock register this register selects the clock frequency for the adc. adiv2:adiv0 ?adc clock prescaler bits adiv2, adiv1, and adiv0 form a 3-bit field which selects the divide ratio used by the adc to generate the internal adc clock. table 12-3 shows the available clock configurations. the adc clock should be set to approximately 1mhz. with an internal bus frequency of 6mhz, set adiv[2:0] = 010, for a divide by four adc clock rate. address: $005f bit 7 654321 bit 0 read: adiv2 adiv1 adiv0 00000 write: reset: 00000000 = unimplemented figure 12-4. adc input clock register (adiclk) table 12-3. adc clock divide ratio adiv2 adiv1 adiv0 adc clock rate 0 0 0 internal bus clock ?1 0 0 1 internal bus clock ?2 0 1 0 internal bus clock ?4 0 1 1 internal bus clock ?8 1 x x internal bus clock ?16 x = don? care f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital converter (adc) technical data mc68HC08BD24 ? rev. 1.0 152 analog-to-digital converter (adc) motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola ddc12ab interface 153 technical data ?mc68HC08BD24 section 13. ddc12ab interface 13.1 contents 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 13.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 13.4 i/o pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 13.5 ddc protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 13.6 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 13.6.1 ddc address register (dadr) . . . . . . . . . . . . . . . . . . . . . 156 13.6.2 ddc2 address register (d2adr) . . . . . . . . . . . . . . . . . . . 157 13.6.3 ddc control register (dcr) . . . . . . . . . . . . . . . . . . . . . . . 158 13.6.4 ddc master control register (dmcr) . . . . . . . . . . . . . . . 159 13.6.5 ddc status register (dsr) . . . . . . . . . . . . . . . . . . . . . . . . 162 13.6.6 ddc data transmit register (ddtr) . . . . . . . . . . . . . . . . 164 13.6.7 ddc data receive register (ddrr). . . . . . . . . . . . . . . . . 165 13.7 programming considerations . . . . . . . . . . . . . . . . . . . . . . . . . 166 13.2 introduction this ddc12ab interface module is used by the digital monitor to show its identification information to the video controller. it contains ddc1 hardware and a two-wire, bidirectional serial bus which is fully compatible with multi-master iic bus protocol to support ddc2ab interface. this module not only can be applied in internal communications, but can also be used as a typical command reception serial bus for factory setup and alignment purposes. it also provides the flexibility of hooking additional devices to an existing system for future expansion without adding extra hardware. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface technical data mc68HC08BD24 ? rev. 1.0 154 ddc12ab interface motorola this ddc12ab module uses the ddcscl clock line and the ddcsda data line to communicate with external ddc host or iic interface. these two pins are shared with port pins ptd3 and ptd2 respectively. the outputs of ddcsda and ddcscl pins are open-drain type ?no clamping diode is connected between the pin and internal v dd . the maximum data rate typically is 100k-bps. the maximum communication length and the number of devices that can be connected are limited by a maximum bus capacitance of 400pf. 13.3 features ddc1 hardware compatibility with multi-master iic bus standard software controllable acknowledge bit generation interrupt driven byte by byte data transfer calling address identification interrupt auto detection of r/w bit and switching of transmit or receive mode detection of start, repeated start, and stop signals auto generation of start and stop condition in master mode arbitration loss detection and no-ack awareness in master mode 8 selectable baud rate master clocks automatic recognition of the received acknowledge bit 13.4 i/o pins the ddc12ab module uses two i/o pins, shared with standard port i/o pins. the full name of the ddc12ab i/o pins are listed in table 13-1 . the generic pin name appear in the text that follows. table 13-1. pin name conventions ddc12ab generic pin names: full mcu pin names: pin selected for ddc function by: sda ptd2/ddcsda ddcdate bit in pdcr ($0049) scl ptd3/ddcscl ddcscle bit in pdcr ($0049) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface i/o pins mc68HC08BD24 ? rev. 1.0 technical data motorola ddc12ab interface 155 table 13-2. ddc i/o register summary addr. register name bit 7 654321 bit 0 $0016 ddc master control register (dmcr) read: alif nakif bb mast mrw br2 br1 br0 write: reset: 00000000 $0017 ddc address register (dadr) read: dad7 dad6 dad5 dad4 dad3 dad2 dad1 extad write: reset: 10100000 $0018 ddc control register (dcr) read: den dien 00 txak sclien ddc1en 0 write: reset: 00000000 $0019 ddc status register (dsr) read: rxif txif match srw rxak sclif txbe rxbf write: 0 0 0 reset: 00001010 $001a ddc data transmit register (ddtr) read: dtd7 dtd6 dtd5 dtd4 dtd3 dtd2 dtd1 dtd0 write: reset: 11111111 $001b ddc data receive register (ddrr) read: drd7 drd6 drd5 drd4 drd3 drd2 drd1 drd0 write: reset: 00000000 $001c ddc2 address register (d2adr) read: d2ad7 d2ad6 d2ad5 d2ad4 d2ad3 d2ad2 d2ad1 0 write: reset: 00000000 = unimplemented f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface technical data mc68HC08BD24 ? rev. 1.0 156 ddc12ab interface motorola 13.5 ddc protocols in ddc1 protocol communication, the module is in transmit mode. the data written to the transmit register is continuously clocked out to the sda line by the rising edge of the vsync input signal. during ddc1 communication, a falling transition on the scl line can be detected to generate an interrupt to the cpu for mode switching. in ddc2ab protocol communication, the module can be either in transmit mode or in receive mode, controlled by the calling master. in ddc2 protocol communication, the module will act as a standard iic module, able to act as a master or a slave device. 13.6 registers seven registers are associated with the ddc module, they outlined in the following sections. 13.6.1 ddc address register (dadr) dad[7:1] ?ddc address these 7 bits can be the ddc2 interface? own specific slave address in slave mode or the calling address when in master mode. reset sets a default value of $a0. address: $0017 bit 7 654321 bit 0 read: dad7 dad6 dad5 dad4 dad3 dad2 dad1 extad write: reset: 10100000 figure 13-1. ddc address register (dadr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface registers mc68HC08BD24 ? rev. 1.0 technical data motorola ddc12ab interface 157 extad ?ddc expanded address this bit is set to expand the calling address of the ddc in slave mode. when set, the ddc will acknowledge the general call address $00 and the matched 4-bit msb address, dad[7:4]. for example, when dad[7:1] = $a1 and extad = 1, the ddc calling address is $a0, and it will acknowledge calling addresses $00 and $a0 to $af. reset clears this bit. 1 = ddc calling address is $dad[7:4]0 ddc respond address is $00, and $dad[7:4]0 to $dad[7:4]f 0 = ddc address id $dad[7:1] 13.6.2 ddc2 address register (d2adr) d2ad[7:1] ?ddc2 address these 7 bits represent the second slave address for the ddc2bi protocol. d2ad[7:1] should be set to the same value as dad[7:1] in dadr if user application do not use ddc2bi. reset clears all bits this register. address: $001c bit 7 654321 bit 0 read: d2ad7 d2ad6 d2ad5 d2ad4 d2ad3 d2ad2 d2ad1 0 write: reset: 00000000 figure 13-2. ddc2 address register (d2adr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface technical data mc68HC08BD24 ? rev. 1.0 158 ddc12ab interface motorola 13.6.3 ddc control register (dcr) den ?ddc enable this bit is set to enable the ddc module. when den = 0, module is disabled and all flags will restore to its power-on default states. reset clears this bit. 1 = ddc module enabled 0 = ddc module disabled dien ?ddc interrupt enable when this bit is set, the txif, rxif, alif, and nakif flags are enabled to generate an interrupt request to the cpu. when dien is cleared, the these flags are prevented from generating an interrupt request. reset clears this bit. 1 = txif, rxif, alif, and/or nakif bit set will generate interrupt request to cpu 0 = txif, rxif, alif, and/or nakif bit set will not generate interrupt request to cpu txak ?transmit acknowledge enable this bit is set to disable the ddc from sending out an acknowledge signal to the bus at the 9th clock bit after receiving 8 data bits. when txak is cleared, an acknowledge signal will be sent at the 9th clock bit. reset clears this bit. 1 = ddc does not send acknowledge signals at 9th clock bit 0 = ddc sends acknowledge signal at 9th clock bit address: $0018 bit 7 654321 bit 0 read: den dien 00 txak sclien ddc1en 0 write: reset: 00000000 = unimplemented figure 13-3. ddc control register (dcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface registers mc68HC08BD24 ? rev. 1.0 technical data motorola ddc12ab interface 159 sclien ?scl interrupt enable when this bit is set, the sclif flag is enabled to generate an interrupt request to the cpu. when sclien is cleared, sclif is prevented from generating an interrupt request. reset clears this bit. 1 = sclif bit set will generate interrupt request to cpu 0 = sclif bit set will not generate interrupt request to cpu ddc1en ?ddc1 protocol enable this bit is set to enable ddc1 protocol. the ddc1 protocol will use the vsync input (from sync processor) as the master clock input to the ddc module. vsync rising-edge will continuously clock out the data to the output circuit. no calling address comparison is performed. the srw bit in ddc status register (dsr) will always read as "1". reset clears this bit. 1 = ddc1 protocol enabled 0 = ddc1 protocol disabled 13.6.4 ddc master control register (dmcr) alif ?ddc arbitration lost interrupt flag the flag is set when software attempt to set mast but the bb has been set by detecting the start condition on the lines or when the ddc is transmitting a "1" to sda line but detected a "0" from sda line in master mode ?an arbitration loss. this bit generates an interrupt request to the cpu if the dien bit in dcr is also set. this bit is cleared by writing "0" to it or by reset. 1 = lost arbitration in master mode 0 = no arbitration lost address: $0016 bit 7 654321 bit 0 read: alif nakif bb mast mrw br2 br1 br0 write: reset: 00000000 figure 13-4. ddc master control register (dmcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface technical data mc68HC08BD24 ? rev. 1.0 160 ddc12ab interface motorola nakif ?no acknowledge interrupt flag the flag is only set in master mode (mast = 1) when there is no acknowledge bit detected after one data byte or calling address is transferred. this flag also clears mast. nakif generates an interrupt request to cpu if the dien bit in dcr is also set. this bit is cleared by writing "0" to it or by reset. 1 = no acknowledge bit detected 0 = acknowledge bit detected bb ?bus busy flag this flag is set after a start condition is detected (bus busy), and is cleared when a stop condition (bus idle) is detected or the ddc is disabled. reset clears this bit. 1 = start condition detected 0 = stop condition detected or ddc is disabled mast ?master control bit this bit is set to initiate a master mode transfer. in master mode, the module generates a start condition to the sda and scl lines, followed by sending the calling address stored in dadr. when the mast bit is cleared by nakif set (no acknowledge) or by software, the module generates the stop condition to the lines after the current byte is transmitted. if an arbitration loss occurs (alif = 1), the module reverts to slave mode by clearing mast, and releasing sda and scl lines immediately. this bit is cleared by writing "0" to it or by reset. 1 = master mode operation 0 = slave mode operation mrw ?master read/write this bit will be transmitted out as bit 0 of the calling address when the module sets the mast bit to enter master mode. the mrw bit determines the transfer direction of the data bytes that follows. when it is "1", the module is in master receive mode. when it is "0", the module is in master transmit mode. reset clears this bit. 1 = master mode receive 0 = master mode transmit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface registers mc68HC08BD24 ? rev. 1.0 technical data motorola ddc12ab interface 161 br2?r0 ?baud rate select these three bits select one of eight clock rates as the master clock when the module is in master mode. since this master clock is derived the cpu bus clock, the user program should not execute the wait instruction when the ddc module in master mode. this will cause the sda and scl lines to hang, as the wait instruction places the mcu in wait mode, with cpu clock is halted. these bits are cleared upon reset. (see table 13-3 . baud rate select .) table 13-3. baud rate select br2 br1 br0 baud rate 0 0 0 100k 001 50k 010 25k 0 1 1 12.5k 1 0 0 6.25k 1 0 1 3.125k 1 1 0 1.56k 1 1 1 0.78k note: cpu bus clock is external clock ?4 = 6mhz f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface technical data mc68HC08BD24 ? rev. 1.0 162 ddc12ab interface motorola 13.6.5 ddc status register (dsr) rxif ?ddc receive interrupt flag this flag is set after the data receive register (ddrr) is loaded with a new received data. once the ddrr is loaded with received data, no more received data can be loaded to the ddrr register until the cpu reads the data from the ddrr to clear rxbf flag. rxif generates an interrupt request to cpu if the dien bit in dcr is also set. this bit is cleared by writing "0" to it or by reset; or when the den = 0. 1 = new data in data receive register (ddrr) 0 = no data received txif ?ddc transmit interrupt flag this flag is set when data in the data transmit register (ddtr) is downloaded to the output circuit, and that new data can be written to the ddtr. txif generates an interrupt request to cpu if the dien bit in dcr is also set. this bit is cleared by writing "0" to it or when the den = 0. 1 = data transfer completed 0 = data transfer in progress match ?ddc address match this flag is set when the received data in the data receive register (ddrr) is an calling address which matches with the address or its extended addresses (extad=1) specified in the dadr register. 1 = received address matches dadr 0 = received address does not match address: $0019 bit 7 654321 bit 0 read: rxif txif match srw rxak sclif txbe rxbf write: 0 0 0 reset: 00001010 = unimplemented figure 13-5. ddc status register (dsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface registers mc68HC08BD24 ? rev. 1.0 technical data motorola ddc12ab interface 163 srw ?ddc slave read/write this bit indicates the data direction when the module is in slave mode. it is updated after the calling address is received from a master device. srw = 1 when the calling master is reading data from the module (slave transmit mode). srw = 0 when the master is writing data to the module (receive mode). 1 = slave mode transmit 0 = slave mode receive rxak ?ddc receive acknowledge when this bit is cleared, it indicates an acknowledge signal has been received after the completion of 8 data bits transmission on the bus. when rxak is set, it indicates no acknowledge signal has been detected at the 9th clock; the module will release the sda line for the master to generate "stop" or "repeated start" condition. reset sets this bit. 1 = no acknowledge signal received at 9th clock bit 0 = acknowledge signal received at 9th clock bit sclif ?scl interrupt flag this flag is set when a falling edge is detected on the scl line, only if ddc1en bit is set. sclif generates an interrupt request to cpu if the sclien bit in dcr is also set. sclif is cleared by writing "0" to it or when the dcc1en = 0, or den = 0. reset clears this bit. 1 = falling edge detected on scl line 0 = no falling edge detected on scl line txbe ?ddc transmit buffer empty this flag indicates the status of the data transmit register (ddtr). when the cpu writes the data to the ddtr, the txbe flag will be cleared. txbe is set when ddtr is emptied by a transfer of its data to the output circuit. reset sets this bit. 1 = data transmit register empty 0 = data transmit register full f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface technical data mc68HC08BD24 ? rev. 1.0 164 ddc12ab interface motorola rxbf ?ddc receive buffer full this flag indicates the status of the data receive register (ddrr). when the cpu reads the data from the ddrr, the rxbf flag will be cleared. rxbf is set when ddrr is full by a transfer of data from the input circuit to the ddrr. reset clears this bit. 1 = data receive register full 0 = data receive register empty 13.6.6 ddc data transmit register (ddtr) when the ddc module is enabled, den = 1, data written into this register depends on whether module is in master or slave mode. in slave mode, the data in ddtr will be transferred to the output circuit when: the module detects a matched calling address (match = 1), with the calling master requesting data (srw = 1); or the previous data in the output circuit has be transmitted and the receiving master returns an acknowledge bit, indicated by a received acknowledge bit (rxak = 0). if the calling master does not return an acknowledge bit (rxak = 1), the module will release the sda line for master to generate a "stop" or "repeated start" condition. the data in the ddtr will not be transferred to the output circuit until the next calling from a master. the transmit buffer empty flag remains cleared (txbe = 0). in master mode, the data in ddtr will be transferred to the output circuit when: address: $001a bit 7 654321 bit 0 read: dtd7 dtd6 dtd5 dtd4 dtd3 dtd2 dtd1 dtd0 write: reset: 11111111 figure 13-6. ddc data transmit register (ddtr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface registers mc68HC08BD24 ? rev. 1.0 technical data motorola ddc12ab interface 165 the module receives an acknowledge bit (rxak = 0), after setting master transmit mode (mrw = 0), and the calling address has been transmitted; or the previous data in the output circuit has be transmitted and the receiving slave returns an acknowledge bit, indicated by a received acknowledge bit (rxak = 0). if the slave does not return an acknowledge bit (rxak = 1), the master will generate a "stop" or "repeated start" condition. the data in the ddtr will not be transferred to the output circuit. the transmit buffer empty flag remains cleared (txbe = 0). the sequence of events for slave transmit and master transmit are illustrated in figure 13-8 . 13.6.7 ddc data receive register (ddrr) when the ddc module is enabled, den = 1, data in this read-only register depends on whether module is in master or slave mode. in slave mode, the data in ddrr is: the calling address from the master when the address match flag is set (match = 1); or the last data received when match = 0. in master mode, the data in the ddrr is: the last data received. address: $001b bit 7 654321 bit 0 read: drd7 drd6 drd5 drd4 drd3 drd2 drd1 drd0 write: reset: 00000000 = unimplemented figure 13-7. ddc data receive register (ddrr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface technical data mc68HC08BD24 ? rev. 1.0 166 ddc12ab interface motorola when the ddrr is read by the cpu, the receive buffer full flag is cleared (rxbf = 0), and the next received data is loaded to the ddrr. each time when new data is loaded to the ddrr, the rxif interrupt flag is set, indicating that new data is available in ddrr. the sequence of events for slave receive and master receive are illustrated in figure 13-8 . 13.7 programming considerations when the ddc module detects an arbitration loss in master mode, it will release both sda and scl lines immediately. but if there are no further stop conditions detected, the module will hang up. therefore, it is recommended to have time-out software to recover from such ill condition. the software can start the time-out counter by looking at the bb (bus busy) flag in the dmcr and reset the counter on the completion of one byte transmission. if a time-out occur, software can clear the den bit (disable ddc module) to release the bus, and hence clearing the bb flag. this is the only way to clear the bb flag by software if the module hangs up due to a no stop condition received. the ddc can resume operation again by setting the den bit. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface programming considerations mc68HC08BD24 ? rev. 1.0 technical data motorola ddc12ab interface 167 figure 13-8. data transfer sequences for master/slave transmit/receive modes start address ack tx data1 txbe=0 mrw=0 mast=1 txif=1 txbe=1 nakif=1 mast=0 txbe=1 (a) master transmit mode (b) master receive mode (c) slave transmit mode txif=1 txbe=0 ack tx datan nak stop txif=1 txbe=1 start address ack rx data1 rxbf=0 mast=1 txbe=0 rxbf=1 rxif=1 nakif=1 mast=0 rxif=1 rxbf=1 ack rx datan nak stop 1 start address ack tx data1 txbe=1 rxbf=0 nakif=1 txbe=0 txbe=1 (d) slave receive mode txif=1 ack tx datan nak stop rxbf=1 rxif=1 match=1 srw=1 txif=1 txbe=1 0 start address ack rx data1 rxbf=1 rxif=1 rxif=1 rxbf=1 ack rx datan nak stop txbe=0 rxbf=0 rxbf=1 rxif=1 match=1 srw=0 data1 ? ddrr datan ? ddrr data1 ? ddtr data2 ? ddtr datan+2 ? ddtr data1 ? ddtr data2 ? ddtr data3 ? ddtr datan+2 ? ddtr (dummy data ? ddtr) mrw=1 data1 ? ddrr datan ? ddrr 0 1 key: shaded data packets indicate a transmit by the mcu? ddc module f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
ddc12ab interface technical data mc68HC08BD24 ? rev. 1.0 168 ddc12ab interface motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 169 technical data ?mc68HC08BD24 section 14. sync processor 14.1 contents 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 14.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 14.4 i/o pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 14.5 functional blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 14.5.1 polarity detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 14.5.1.1 hsync polarity detection . . . . . . . . . . . . . . . . . . . . . . . . 174 14.5.1.2 vsync polarity detection . . . . . . . . . . . . . . . . . . . . . . . . 174 14.5.1.3 composite sync polarity detection . . . . . . . . . . . . . . . . 174 14.5.2 sync signal counters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 14.5.3 polarity controlled hsynco and vsynco outputs. . . . . 175 14.5.4 clamp pulse output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 14.5.5 low vertical frequency detect . . . . . . . . . . . . . . . . . . . . . 177 14.6 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 14.6.1 sync processor control & status register (spcsr). . . . . 177 14.6.2 sync processor input/output control register (spiocr) . 179 14.6.3 vertical frequency registers (vfrs). . . . . . . . . . . . . . . . . 181 14.6.4 hsync frequency registers (hfrs). . . . . . . . . . . . . . . . . . 183 14.6.5 sync processor control register 1 (spcr1). . . . . . . . . . . 185 14.6.6 h&v sync output control register (hvocr) . . . . . . . . . . 186 14.7 system operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 170 sync processor motorola 14.2 introduction the sync processor is designed to detect and process sync signals inside a digital monitor system ?from separated hsync and vsync inputs, or from composite sync inputs such as sync-on-green (sog). after detection and the necessary polarity correction and/or sync separation, the corrected sync signals are sent out. the mcu can also send commands to other monitor circuitry, such as for the geometry correction and osd, using the ddc12ab and/or the iic communication channels. the block diagram of the sync processor is shown in figure 14-1 . note: all quoted timings in this section assume an internal bus frequency of 6mhz. 14.3 features features of the sync processor include the following: polarity detector horizontal frequency counter vertical frequency counter low vertical frequency indicator (40.7hz) polarity controlled hsynco and vsynco outputs: from separate hsync and vsync from composite sync on hsync or sog input pin from internal selectable free running hsync and vsync pulses clamp pulse output to the external pre-amp chip internal schmitt trigger on hsync, vsync, and sog input pins to improve noise immunity f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor i/o pins mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 171 14.4 i/o pins the sync processor uses six i/o pins, with four pins shared with standard port i/o pins. the full name of the sync processor i/o pins are listed in table 14-1 . the generic pin name appear in the text that follows. table 14-1. pin name conventions sync processor generic pin names: full mcu pin names: pin selected for sync processor function by: hsync hsync vsync vsync sog pte0/sog/tch0 soge bit in config1 ($001d) hsynco pte1/hsynco hsyncoe bit in config 1 ($001d) vsynco pte2/vsynco vsyncoe bit in config 1 ($001d) clamp ptd4/clamp clampe bit in pdcr ($0049) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 172 sync processor motorola table 14-2. sync processor i/o register summary addr. register name bit 7 654321 bit 0 $0040 sync processor control and status register (spcsr) read: vsie vedge vsif comp vinvo hinvo vpol hpol write: 0 reset: 00000000 $0041 vertical frequency high register (vfhr) read: vof 0 0 vf12 vf11 vf10 vf9 vf8 write: cpw1 cpw0 reset: 00000000 $0042 vertical frequency low register (vflr) read: vf7 vf6 vf5 vf4 vf3 vf2 vf1 vf0 write: reset: 00000000 $0043 hsync frequency high register (hfhr) read: hfh7 hfh6 hfh5 hfh4 hfh3 hfh2 hfh1 hfh0 write: reset: 00000000 $0044 hsync frequency low register (hflr) read: hover 0 0 hfl4 hfl3 hfl2 hfl1 hfl0 write: reset: 00000000 $0045 sync processor i/o control register (spiocr) read: vsyncs hsyncs coinv r sogsel clampoe bpor sout write: reset: 00000000 $0046 sync processor control register 1 (spcr1) read: lvsie lvsif hps1 hps0 r r atpol fshf write: 0 reset: 00000000 $0047 h&v sync output control register (hvocr) read: r 0000 hvocr2 hvocr1 hvocr0 write: reset: 00000000 = unimplemented r = reserved f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor functional blocks mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 173 14.5 functional blocks figure 14-1. sync processor block diagram 13-bit counter ?48 a 1 b s extracted vsync a 1 b s svf comp sout vinvo vsynco polarity detect edge detect vpol one shot vedge internal bus clock overflow detect vof lvsie to interrupt logic 13-bit counter one shot overflow detect clk32/32.768 a 1 b s hsync sog sogsel a 1 b s polarity detect hpol comp vsync extractor extracted vsync b a 1 s h/v sync 2 m s pulse generator svf shf clamp pulse generator clamp hsynco vflr vfhr hflr hfhr bpor coinv sout hover vpol vsie vsif $c00 detect lvsif hinvo hvocr[2:0] vsync (125 khz) (6 mhz) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 174 sync processor motorola 14.5.1 polarity detection 14.5.1.1 hsync polarity detection the hsync polarity detection circuit measures the length of high and low period of the hsync input. if the length of high is longer than l and the length of low is shorter than s , the hpol bit will be "0", indicating a negative polarity hsync input. if the length of low is longer than l and the length of high is shorter than s , the hpol bit will be "1", indicating a positive polarity hsync input. the table below shows three possible cases for hsync polarity detection ?the conditions are selected by the hps[1:0] bits in the sync processor control register 1 (spcr1). 14.5.1.2 vsync polarity detection the vsync polarity detection circuit performs a similar function as for hsync. if the length of high is longer than 4ms and the length of low is shorter than 2ms, the vpol bit will be "0", indicating a negative polarity vsync input. if the length of low is longer than 4ms and the length of high is shorter than 2ms, the vpol bit will be "1", indicating a positive polarity vsync input. 14.5.1.3 composite sync polarity detection when a composite sync signal is the input (comp = 1 for composite sync processing), the hpol bit = vpol bit, and the polarity is detected using the vsync polarity detection criteria described in section 14.5.1.2 . polarity detection pulse width spcr1 ($0046) long is greater than ( l ) short is less than ( s ) hps1 hps0 7 m s6 m s00 3.5 m s3 m s1x 14 m s12 m s01 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor functional blocks mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 175 14.5.2 sync signal counters there are two counters: a 13-bit horizontal frequency counter to count the number of horizontal sync pulses within a 32ms or 8ms period; and a 13-bit vertical frequency counter to count the number of system clock cycles between two vertical sync pulses. these two data can be read by the cpu to check the signal frequencies and to determine the video mode. the 13-bit vertical frequency register encompasses vertical frequency range from approximately 15hz to 128khz. due to the asynchronous timing between the incoming vsync signal and internal system clock, there will be 1 count error on reading the vertical frequency registers (vfrs) for the same vertical frequency. the horizontal counter counts the pulses on hsync pin input, and is uploaded to the hsync frequency registers (hfrs) every 32.768ms or 8.192ms. 14.5.3 polarity controlled hsynco and vsynco outputs the processed sync signals are output on hsynco and vsynco when the corresponding bits in configuration register 0 ($001d) are set. the signal to these output pins depend on sout and comp bits (see table 14-3 ), with polarity controlled by atpol, hinvo, and vinvo bits as shown in table 14-4 . table 14-3. sync output control sout comp sync outputs: vsynco and hsynco 1 x free-running pulse with negative polarity 00 sync outputs follow sync inputs vsync and hsync respectively, with polarity correction shown in table 14-4 . 01 hsynco follows the composite sync input and vsynco is the extracted vsync (3 to 14 m s delay to composite input), with polarity correction shown in table 14-4 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 176 sync processor motorola when the sout bit is set, the hsynco output is a free-running pulse with 2 m s width. both hsynco and vsynco outputs are negative polarity, with frequencies selected by the h & v sync output control register (hvocr). 14.5.4 clamp pulse output when the clampoe bit in spiocr is set to "1", a clamp signal is output on the clamp pin. this clamp pulse is triggered either on the leading edge or the trailing edge of hsync, controlled by bpor bit, with the polarity controlled by the coinv bit. see figure 14-2 . clamp pulse output timing . figure 14-2. clamp pulse output timing table 14-4. sync output polarity atpol sout vinvo or hinvo sync outputs: vsynco/hsynco x 1 x free-running pulse with negative polarity 0 0 0 same polarity as sync input 0 0 1 inverted polarity of sync input 1 0 0 negative polarity sync output 1 0 1 positive polarity sync output pulse width = 0.33~2.1 m s pulse width = 0.33~2.1 m s pulse width = 0.33~2.1 m s pulse width = 0.33~2.1 m s hsync (hpol = 1) clamp (bpor = 0) clamp (bpor = 1) hsync (hpol = 0) clamp (bpor = 0) clamp (bpor = 1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor registers mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 177 14.5.5 low vertical frequency detect logic monitors the value of the vsync frequency register (vfr), and sets the low vertical frequency flag (lvsif) when the value of vfr is higher than $c00 (frequency below 40.7hz). lvsif bit can generate an interrupt request to the cpu when the lvsie bit is set and i-bit in the condition code register is "0". the lvsif bit can help the system to detect video off mode fast. 14.6 registers eight registers are associated with the sync processor, they outlined in the following sections. 14.6.1 sync processor control & status register (spcsr) vsie ?vsync interrupt enable when this bit is set, the vsif flag is enabled to generate an interrupt request to the cpu. when vsie is cleared, the vsif flag is prevented from generating an interrupt request to the cpu. reset clears this bit. 1 = vsif bit set will generate interrupt request to cpu 0 = vsif bit set does not generate interrupt request to cpu address: $0040 bit 7 654321 bit 0 read: vsie vedge vsif comp vinvo hinvo vpol hpol write: 0 reset: 00000000 = unimplemented figure 14-3. sync processor control & status register (spcsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 178 sync processor motorola vedge ?vsync interrupt edge select this bit specifies the triggering edge of vsync interrupt. when it is "0", the rising edge of internal vsync signal which is either from the vsync pin or extracted from the composite input signal will set vsif flag. when it is "1", the falling edge of internal vsync signal will set vsif flag. reset clears this bit. 1 = vsif bit will be set by rising edge of vsync 0 = vsif bit will be set by falling edge of vsync vsif ?vsync interrupt flag this flag is only set by the specified edge of the internal vsync signal, which is either from the vsync input pin or extracted from the composite sync input signal. the triggering edge is specified by the vedge bit. vsif generates an interrupt request to the cpu if the vsie bit is also set. this bit is cleared by writing a "0" to it or by a reset. 1 = a valid edge is detected on the vsync 0 = no valid vsync is detected comp ?composite sync input enable this bit is set to enable the separator circuit which extracts the vsync pulse from the composite sync input on hsync or sog pin (select by sogsel bit). the extracted vsync signal is used as it were from the vsync input. reset clears this bit. 1 = composite sync input enabled 0 = composite sync input disabled vinvo vsynco signal polarity this bit, together with the atpol bit in spcr1 controls the output polarity of the vsynco signal (see table 14-5 ). hinvo ?hsynco signal polarity this bit, together with the atpol bit in spcr1 controls the output polarity of the hsynco signal (see table 14-5 ). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor registers mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 179 vpol ?vsync input polarity this bit indicates the polarity of the vsync input, or the extracted vsync from a composite sync input (comp=1). reset clears this bit. 1 = vsync is positive polarity 0 = vsync is negative polarity hpol hsync input polarity this bit indicates the polarity of the hsync input. this bit equals the vpol bit when the comp bit is set. reset clears this bit. 1 = hsync is positive polarity 0 = hsync is negative polarity 14.6.2 sync processor input/output control register (spiocr) vsyncs ?vsync input state this read-only bit reflects the logical state of the vsync input. hsyncs ?hsync input state this read-only bit reflects the logical state of the hsync input. table 14-5. atpol, vinvo, and hinvo setting atpol vinvo / hinvo sync outputs: vsynco/hsynco 0 0 same polarity as sync input 0 1 inverted polarity of sync input 1 0 negative polarity sync output 1 1 positive polarity sync output address: $0045 bit 7 654321 bit 0 read: vsyncs hsyncs coinv r sogsel clampoe bpor sout write: reset: 00000000 = unimplemented r = reserved figure 14-4. sync processor input/output control register (spiocr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 180 sync processor motorola coinv ?clamp output invert this bit is set to invert the clamp pulse output to negative. reset clears this bit. 1 = clamp output is set for negative pulses 0 = clamp output is set for positive pulses sogsel sog select this bit selects either the hsync pin or sog pin as the composite sync signal input pin. reset clears this bit. 1 = sog pin is used as the composite sync input 0 = hsync pin is used as the composite sync input clampoe clamp output enable this bit is set to enable the clamp pulse output circuitry. reset clears this bit. 1 = clamp pulse circuit enabled 0 = clamp pulse circuit disabled bpor ?back porch this bit defines the triggering edge of the clamp pulse output relative to the hsync input. reset clears this bit. 1 = clamp pulse is generated on the trailing edge of hsync 0 = clamp pulse is generated on the leading edge of hsync sout ?sync output enable this bit will select the output signals for the vsynco and hsynco pins. reset clears this bit. 1 = vsynco and hsynco outputs are internally generated free-running sync pulses with frequencies determined by hvcor[2:0] bits in hvcor. 0 = vsynco and hsynco outputs are processed vsync and hsync inputs respectively f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor registers mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 181 14.6.3 vertical frequency registers (vfrs) this register pair contains the 13-bit vertical frequency count value, an overflow bit, and the clamp pulse width selection bits. vf[12:0] ?vertical frame frequency\ this read-only 13-bit contains information of the vertical frame frequency. an internal 13-bit counter counts the number of 8 m s periods between two vsync pulses. the most significant 5 bits of the counted value is transferred to the high byte register, and the least significant 8 bits is transferred to an intermediate buffer. when the high byte register is read, the 8-bit counted value stored in the intermediate buffer will be uploaded to the low byte register. therefore, user program must read the high byte register first, then low byte register in order to get the complete counted value of one vertical frame. if the counter overflows, the overflow flag, vof, will be set, indicating the counter value stored in the vfrs is meaningless. the data corresponds to the period of one vertical frame. this register can be read to determine if the frame frequency is valid, and to determine the video mode. address: $0041 bit 7 654321 bit 0 read: vof 0 0 vf12 vf11 vf10 vf9 vf8 write: cpw1 cpw0 reset: 00000000 figure 14-5. vertical frequency high register address: $0042 bit 7 654321 bit 0 read: vf7 vf6 vf5 vf4 vf3 vf2 vf1 vf0 write: reset: 00000000 = unimplemented figure 14-6. vertical frequency low register f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 182 sync processor motorola the frame frequency is calculated by: table 14-6 shows examples for the vertical frequency register, all vfr numbers are in hexadecimal. vof ?vertical frequency counter overflow this read-only bit is set when an overflow has occurred on the 13-bit vertical frequency counter. reset clears this bit, and will be updated every vertical frame. an overflow occurs when the period of vsync frame exceeds 64.768ms (a vertical frame frequency lower than 15.258hz). 1 = a vertical frequency counter overflow has occurred 0 = no vertical frequency counter overflow has occurred table 14-6. sample vertical frame frequencies vfr max freq. min freq. vfr max freq. min freq. $02a0 186.20 hz 185.70 hz $0780 65.10 hz 65.00 hz $03c0 130.34 hz 130.07 hz $0823 60.04 hz 59.98 hz $03c1 130.21 hz 129.94 hz $0824 60.01 hz 59.95 hz $03c2 130.07 hz 129.80 hz $0825 59.98 hz 59.92 hz $04e2 100.08 hz 99.92 hz $09c4 50.02 hz 49.98 hz $04e3 100.00 hz 99.84 hz $09c5 50.00 hz 49.96 hz $04e4 99.92 hz 99.76 hz $09c6 49.98 hz 49.94 hz $06f9 70.07 hz 69.99 hz $1ffd 15.266 hz 15.262 hz $06fa 70.03 hz 69.95 hz $1ffe 15.264 hz 15.260 hz $06fb 69.99 hz 69.91 hz $1fff 15.262 hz 15.258 hz vertical frame frequency 1 vfr 1 48 t cyc -------------------------------------------------- - = 1 vfr 1 8 m s ------------------------------------- - = for internal bus clock of 6 mhz f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor registers mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 183 cpw[1:0] ?clamp pulse width the cpw1 and cpw0 bits are used to select the output clamp pulse width. reset clears these bits, selecting a default clamp pulse width between 0.33 m s and 0.375 m s. these bits always read as zeros. 14.6.4 hsync frequency registers (hfrs) this register pair contains the 13-bit hsync frequency count value and an overflow bit. table 14-7. clamp pulse width cpw1 cpw0 clamp pulse width 0 0 0.33 m s to 0.375 m s 0 1 0.5 m s to 0.542 m s 1 0 0.75 m s to 0.792 m s 112 m s to 2.042 m s address: $0043 bit 7 654321 bit 0 read: hfh7 hfh6 hfh5 hfh4 hfh3 hfh2 hfh1 hfh0 write: reset: 00000000 figure 14-7. hsync frequency high register address: $0044 bit 7 654321 bit 0 read: hover 0 0 hfl4 hfl3 hfl2 hfl1 hfl0 write: reset: 00000000 = unimplemented figure 14-8. hsync frequency low register f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 184 sync processor motorola hfh[7:0], hfl[4:0] ?horizontal line frequency this read-only 13-bit contains the number of horizontal lines in a 32ms window. an internal 13-bit counter counts the hsync pulses within a 32ms window in every 32.768ms period. if the fshf bit in spcr1 is set, only the most 11-bits (hfh[7:0] & hfl[4:2]) will be updated by the counter. thus, providing a hsync pulse count in a 8ms window in every 8.192ms. the most significant 8 bits of counted value is transferred to the high byte register, and the least significant 5 bits is transferred to an intermediate buffer. when the high byte register is read, the 5-bit counted value stored in the intermediate buffer will be uploaded to the low byte register. therefore, user the program must read the high byte register first then low byte register in order to get the complete counted value of hsync pulses. if the counter overflows, the overflow flag, hover, will be set, indicating the number of hsync pulses in 32ms are more than 8191 (2 13 1), i.e. a hsync frequency greater than 256khz. for the 32ms window, the hfhr and hflr are such that the frequency step unit in the 5-bit of hflr is 0.03125khz, and the step unit in the 8-bit hfhr is 1khz. therefore, the hsync frequency can be easily calculated by: hover ?hsync frequency counter overflow this read-only bit is set when an overflow has occurred on the 13-bit hsync frequency counter. reset clears this bit, and will be updated every count period. an overflow occurs when the number hsync pulses exceed 8191, a hsync frequency greater than 256khz. 1 = a hsync frequency counter overflow has occurred 0 = no hsync frequency counter overflow has occurred hsync frequency = [ hfh + ( hfl 0.03125)]khz where: hfh is the value of hfh[7:0] hfl is the value of hfl[4:0] f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor registers mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 185 14.6.5 sync processor control register 1 (spcr1) lvsie ?low vsync interrupt enable when this bit is set, the lvsif flag is enabled to generate an interrupt request to the cpu. when lvsie is cleared, the lvsif flag is prevented from generating an interrupt request to the cpu. reset clears this bit. 1 = low vsync interrupt enabled 0 = low vsync interrupt disabled lvsif ?low vsync interrupt flag this read-only bit is set when the value of vfr is higher than $c00 (vertical frame frequency below 40.7hz). lvsif generates an interrupt request to the cpu if the lvsie is also set. this bit is cleared by writing a "0" to it or reset. 1 = vertical frequency is below 40.7hz 0 = vertical frequency is higher than 40.7hz hps[1:0] ?hsync input detection pulse width these two bits control the detection pulse width of hsync input. reset clears these two bits, setting a default middle frequency of hsync input. address: $0046 bit 7 654321 bit 0 read: lvsie lvsif hps1 hps0 r r atpol fshf write: 0 reset: 00000000 = unimplemented r = reserved figure 14-9. sync processor control register 1 (spcr1) table 14-8. hsync polarity detection pulse width hps1 hps0 polarity detection pulse width 0 0 long > 7 m s and short < 6 m s 1 x long > 3.5 m s and short < 3 m s 0 1 long > 14 m s and short < 12 m s f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 186 sync processor motorola atpol ?auto polarity this bit, together with the vinvo or hinvo bits in spcsr controls the output polarity of the vsynco or hsynco signals respectively. reset clears this bit (see table 14-9 ). fshf ?fast horizontal frequency count this bit is set to shorten the measurement cycle of the horizontal frequency. if it is set, only hfh[7:0] and hfl[4:2] will be updated by the hsync counter, providing a count in a 8ms window in every 8.192ms, with hfl[1:0] reading as zeros. therefore, user can determine the horizontal frequency change within 8.192ms to protect critical circuitry. reset clears this bit. 1 = number of hsync pulses is counted in an 8ms window 0 = number of hsync pulses is counted in a 32ms window 14.6.6 h&v sync output control register (hvocr) table 14-9. atpol, vinvo, and hinvo setting atpol vinvo / hinvo sync outputs: vsynco/hsynco 0 0 same polarity as sync input 0 1 inverted polarity of sync input 1 0 negative polarity sync output 1 1 positive polarity sync output address: $0047 bit 7 654321 bit 0 read: r 0000 hvocr2 hvocr1 hvocr0 write: reset: 00000000 = unimplemented r = reserved figure 14-10. h&v sync output control register (hvocr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor system operation mc68HC08BD24 ? rev. 1.0 technical data motorola sync processor 187 hvocr[2:0] ?h&v output select bits these three bits select the frequencies of the internal generated free-running sync pulses for output to hsynco and vsynco pins, when the sout bit is set in the spiocr. reset clears these bits, setting a default horizontal frequency of 31.25khz and a vertical frequency of 60hz, a video mode of 640 480. 14.7 system operation this sync processor is designed to assist in determining the video mode of incoming hsync and vsync of various frequencies and polarities, and dpms modes. in the dpms standard, a no sync pulses definition can be detected when the value of the hsync frequency register (the number of hsync pulses) is less than one or when the vof bit is set. since the hsync frequency register is updated repeatedly in every 32.768ms, and a valid vsync must have a frequency greater than 40.7hz, a valid vsync pulse will arrive within the 32.768ms window. therefore, the user should read the hsync frequency register every 32.768ms to determine the presence of hsync and/or vsync pulses. table 14-10. free-running hsync and vsync options hvocr hsynco vsynco video mode pulse width frequency pulse width frequency 000 negative 2 m s 31.25khz negative 192 m s 59.98 hz 640 480 001 negative 2 m s 43.48khz negative 138 m s 84.92 hz 640 480 010 negative 2 m s 48.78khz negative 123 m s 60.00 hz 1024 768 011 negative 2 m s 54.05khz negative 111 m s 84.98 hz 800 600 100 negative 2 m s 60.61khz negative 99 m s 75.01 hz 1024 768 101 negative 2 m s 80.00khz negative 75 m s 74.98 hz 1280 1024 110 negative 2 m s 90.91khz negative 66 m s 84.96 hz 1280 1024 111 negative 2 m s 105.26khz negative 57 m s 85.02 hz 1600 1200 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
sync processor technical data mc68HC08BD24 ? rev. 1.0 188 sync processor motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 189 technical data ?mc68HC08BD24 section 15. input/output (i/o) ports 15.1 contents 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 15.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 15.3.1 port a data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 15.3.2 data direction register a . . . . . . . . . . . . . . . . . . . . . . . . . 194 15.3.3 port a options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 15.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 15.4.1 port b data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 15.4.2 data direction register b . . . . . . . . . . . . . . . . . . . . . . . . . 197 15.4.3 port b options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 15.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 15.5.1 port c data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 15.5.2 data direction register c . . . . . . . . . . . . . . . . . . . . . . . . . 200 15.5.3 port c options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 15.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 15.6.1 port d data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 15.6.2 data direction register d. . . . . . . . . . . . . . . . . . . . . . . . . . 203 15.6.3 port d options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 15.7 port e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 15.7.1 port e data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 15.7.2 data direction register e. . . . . . . . . . . . . . . . . . . . . . . . . . 207 15.7.3 port e options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 190 input/output (i/o) ports motorola 15.2 introduction thirty-two (32) bidirectional input-output (i/o) pins form four parallel ports. all i/o pins are programmable as inputs or outputs. note: connect any unused i/o pins to an appropriate logic level, either v dd or v ss . although the i/o ports do not require termination for proper operation, termination reduces excess current consumption and the possibility of electrostatic damage. table 15-1. i/o port register summary addr. register name bit 7 654321 bit 0 $0000 port a data register (pta) read: pta7 pta6 pta5 pta4 pta3 pta2 pta1 pta0 write: reset: unaffected by reset $0001 port b data register (ptb) read: ptb7 ptb6 ptb5 ptb4 ptb3 ptb2 ptb1 ptb0 write: reset: unaffected by reset $0002 port c data register (ptc) read: 0 0 ptc5 ptc4 ptc3 ptc2 ptc1 ptc0 write: reset: unaffected by reset $0003 port d data register (ptd) read: 0 ptd6 ptd5 ptd4 ptd3 ptd2 ptd1 ptd0 write: reset: unaffected by reset $0004 data direction register a (ddra) read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset: 00000000 $0005 data direction register b (ddrb) read: ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 write: reset: 00000000 = unimplemented f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports introduction mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 191 $0006 data direction register c (ddrc) read: 0 0 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 00000000 $0007 data direction register d (ddrd) read: 0 ddrd6 ddrd5 ddrd4 ddrd3 ddrd2 ddrd1 ddrd0 write: reset: 00000000 $0008 port e data register (pte) read: 00000 pte2 pte1 pte0 write: reset: unaffected by reset $0009 data direction register e (ddre) read: 00000 ddre2 ddre1 ddre0 write: reset: 00000000 $001d configuration register 0 (config0) read: hsyncoe vsyncoe soge 00000 write: reset: 00000000 $0028 pwm control register 1 (pwmcr1) read: pwm7e pwm6e pwm5e pwm4e pwm3e pwm2e pwm1e pwm0e write: reset: 00000000 $0049 port d configuration register (pdcr) read: 0 0 0 clampe ddcscle ddcdate 00 write: reset: 00000000 $0059 pwm control register 2 (pwmcr2) read: pwm15e pwm14e pwm13e pwm12e pwm11e pwm10e pwm9e pwm8e write: reset: 00000000 table 15-1. i/o port register summary (continued) addr. register name bit 7 654321 bit 0 = unimplemented f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 192 input/output (i/o) ports motorola table 15-2. port control register bits summary port bit ddr module control pin module register control bit a 0 ddra0 pwm pwmcr2 $0059 pwm8e pta0/pwm8 1 ddra1 pwm9e pta1/pwm9 2 ddra2 pwm10e pta2/pwm10 3 ddra3 pwm11e pta3/pwm11 4 ddra4 pwm12e pta4/pwm12 5 ddra5 pwm13e pta5/pwm13 6 ddra6 pwm14e pta6/pwm14 7 ddra7 pwm15e pta7/pwm15 b 0 ddrb0 pwm pwmcr1 $0028 pwm0e ptb0/pwm0 1 ddrb1 pwm1e ptb1/pwm1 2 ddrb2 pwm2e ptb2/pwm2 3 ddrb3 pwm3e ptb3/pwm3 4 ddrb4 pwm4e ptb4/pwm4 5 ddrb5 pwm5e ptb5/pwm5 6 ddrb6 pwm6e ptb6/pwm6 7 ddrb7 pwm7e ptb7/pwm7 c 0 ddrc0 adc adscr $005d adch[4:0] ptc0/adc0 1 ddrc1 ptc1/adc1 2 ddrc2 ptc2/adc2 3 ddrc3 ptc3/adc3/ 4 ddrc4 ptc4/adc4 5 ddrc5 ptc5/adc5 d 0 ddrd0 ptd0 1 ddrd1 ptd1 2 ddrd2 ddc12ab pdcr $0049 ddcdate ptd2/ddcsda 3 ddrd3 ddcscle ptd3/ddcscl 4 ddrd4 sync clampe ptd4/clamp 5 ddrd5 ptd5 6 ddrd6 ptd6 e 0 ddre0 sync/tim config0 $001d soge pte0/sog/tch0 1 ddre1 sync hsyncoe pte1/hsynco 2 ddre2 vsyncoe pte2/vsynco f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port a mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 193 15.3 port a port a is an 8-bit special-function port that shares all eight of its pins with the pulse width modulator (pwm). 15.3.1 port a data register the port a data register (pta) contains a data latch for each of the eight port a pins. pta7?ta0 ?port a data bits these read/write bits are software programmable. data direction of each port a pin is under the control of the corresponding bit in data direction register a. reset has no effect on port a data. pwm15?wm8 ?pwm outputs 15? the pwm output enable bits pwm15e?wm8e, in pwm control register 2 (pwmcr2) enable port a pins as pwm output pins. (see 15.3.3 port a options .) address: $0000 bit 7 654321 bit 0 read: pta7 pta6 pta5 pta4 pta3 pta2 pta1 pta0 write: reset: unaffected by reset alternate function: pwm15 pwm14 pwm13 pwm12 pwm11 pwm10 pwm9 pwm8 figure 15-1. port a data register (pta) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 194 input/output (i/o) ports motorola 15.3.2 data direction register a data direction register a (ddra) determines whether each port a pin is an input or an output. writing a logic 1 to a ddra bit enables the output buffer for the corresponding port a pin; a logic 0 disables the output buffer. ddra7?dra0 ?data direction register a bits these read/write bits control port a data direction. reset clears ddra7?dra0, configuring all port a pins as inputs. 1 = corresponding port a pin configured as output 0 = corresponding port a pin configured as input note: avoid glitches on port a pins by writing to the port a data register before changing data direction register a bits from 0 to 1. figure 15-3 shows the port a i/o logic. figure 15-3. port a i/o circuit address: $0004 bit 7 654321 bit 0 read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset: 00000000 figure 15-2. data direction register a (ddra) read ddra ($0004) write ddra ($0004) reset write pta ($0000) read pta ($0000) ptax ddrax ptax internal data bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port a mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 195 when bit ddrax is a logic 1, reading address $0000 reads the ptax data latch. when bit ddrax is a logic 0, reading address $0000 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 15-3 summarizes the operation of the port a pins. 15.3.3 port a options the pwm control register 2 (pwmcr2) selects the port a pins for pwm function or as standard i/o function. see 11.4.2 pwm control registers 1 and 2 (pwmcr1:pwmcr2) . pwm15e?wm8e ?pwm output enable 15? setting a bit to "1" will configure the corresponding ptax/pwmx pin for pwm output function. reset clears these bits. 1 = ptax/pwmx pin configured as pwmx output pin 0 = ptax/pwmx pin configured as standard i/o pin table 15-3. port a pin functions ptapue bit ddra bit pta bit i/o pin mode accesses to ddra accesses to pta read/write read write 00x (1) input, hi-z (2) ddra7?dra0 pin pta7?ta0 (3) x 1 x output ddra7?dra0 pta7?ta0 pta7?ta0 notes: 1. x = don? care 2. hi-z = high impedance 3. writing affects data register, but does not affect input. address: $0059 bit 7 654321 bit 0 read: pwm15e pwm14e pwm13e pwm12e pwm11e pwm10e pwm9e pwm8e write: reset: 00000000 figure 15-4. pwm control register 1 (pwmcr1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 196 input/output (i/o) ports motorola 15.4 port b port b is an 8-bit special-function port that shares all eight of its pins with the pulse width modulator (pwm). 15.4.1 port b data register the port b data register (ptb) contains a data latch for each of the eight port pins. ptb7?tb0 ?port b data bits these read/write bits are software-programmable. data direction of each port b pin is under the control of the corresponding bit in data direction register b. reset has no effect on port b data. pwm7?wm0 ?pwm outputs 7? the pwm output enable bits pwm7e?wm0e, in pwm control register 1 (pwmcr1) enable port b pins as pwm output pins. (see 15.4.3 port b options .) address: $0001 bit 7 654321 bit 0 read: ptb7 ptb6 ptb5 ptb4 ptb3 ptb2 ptb1 ptb0 write: reset: unaffected by reset alternate function: pwm7 pwm6 pwm5 pwm4 pwm3 pwm2 pwm1 pwm0 figure 15-5. port b data register (ptb) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port b mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 197 15.4.2 data direction register b data direction register b (ddrb) determines whether each port b pin is an input or an output. writing a logic 1 to a ddrb bit enables the output buffer for the corresponding port b pin; a logic 0 disables the output buffer. ddrb7?drb0 ?data direction register b bits these read/write bits control port b data direction. reset clears ddrb7?drb0], configuring all port b pins as inputs. 1 = corresponding port b pin configured as output 0 = corresponding port b pin configured as input note: avoid glitches on port b pins by writing to the port b data register before changing data direction register b bits from 0 to 1. figure 15-7 shows the port b i/o logic. figure 15-7. port b i/o circuit address: $0005 bit 7 654321 bit 0 read: ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 write: reset: 00000000 figure 15-6. data direction register b (ddrb) read ddrb ($0005) write ddrb ($0005) reset write ptb ($0001) read ptb ($0001) ptbx ddrbx ptbx internal data bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 198 input/output (i/o) ports motorola when bit ddrbx is a logic 1, reading address $0001 reads the ptbx data latch. when bit ddrbx is a logic 0, reading address $0001 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 15-4 summarizes the operation of the port b pins. 15.4.3 port b options the pwm control register 1 (pwmcr1) selects the port b pins for pwm function or as standard i/o function. see 11.4.2 pwm control registers 1 and 2 (pwmcr1:pwmcr2) . pwm7e?wm0e ?pwm output enable 7? setting a bit to "1" will configure the corresponding ptbx/pwmx pin for pwm output function. reset clears these bits. 1 = ptbx/pwmx pin configured as pwmx output pin 0 = ptbx/pwmx pin configured as standard i/o pin table 15-4. port b pin functions ddrb bit ptb bit i/o pin mode accesses to ddrb accesses to ptb read/write read write 0x (1) input, hi-z (2) ddrb7?drb0 pin ptb7?tb0 (3) 1 x output ddrb7?drb0 ptb7?tb0 ptb7?tb0 notes: 1. x = don? care 2. hi-z = high impedance 3. writing affects data register, but does not affect input. address: $0028 bit 7 654321 bit 0 read: pwm7e pwm6e pwm5e pwm4e pwm3e pwm2e pwm1e pwm0e write: reset: 00000000 figure 15-8. pwm control register 1 (pwmcr1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port c mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 199 15.5 port c port c is an 6-bit special-function port that shares all six of its pins with the analog-to-digital converter (adc) module. 15.5.1 port c data register the port c data register (ptc) contains a data latch for each of the seven port c pins. ptc5?tc0 ?port c data bits these read/write bits are software-programmable. data direction of each port c pin is under the control of the corresponding bit in data direction register c. reset has no effect on port c data. adc5?dc0 ?analog-to-digital input bits adc5?dc0 are pins used for the input channels to the analog-to- digital converter module. the channel select bits in the adc status and control register define which port c pin will be used as an adc input and overrides any control from the port i/o logic by forcing that pin as the input to the analog circuitry. note: care must be taken when reading port c while applying analog voltages to adc5?dc0 pins. if the appropriate adc channel is not enabled, excessive current drain may occur if analog voltages are applied to the ptcx/adcx pin, while ptc is read as a digital input. those ports not selected as analog input channels are considered digital i/o ports. address: $0002 bit 7 654321 bit 0 read: 0 0 ptc5 ptc4 ptc3 ptc2 ptc1 ptc0 write: reset: unaffected by reset alternate function: adc5 adc4 adc3 adc2 adc1 adc0 = unimplemented figure 15-9. port c data register (ptc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 200 input/output (i/o) ports motorola 15.5.2 data direction register c data direction register c (ddrc) determines whether each port c pin is an input or an output. writing a logic 1 to a ddrc bit enables the output buffer for the corresponding port c pin; a logic 0 disables the output buffer. ddrc6?drc0 ?data direction register c bits these read/write bits control port c data direction. reset clears ddrc6?drc0, configuring all port c pins as inputs. 1 = corresponding port c pin configured as output 0 = corresponding port c pin configured as input note: avoid glitches on port c pins by writing to the port c data register before changing data direction register c bits from 0 to 1. figure 15-11 shows the port c i/o logic. figure 15-11. port c i/o circuit address: $0006 bit 7 654321 bit 0 read: 0 ddrc6 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 00000000 = unimplemented figure 15-10. data direction register c (ddrc) read ddrc ($0006) write ddrc ($0006) reset write ptc ($0002) read ptc ($0002) ptcx ddrcx ptcx internal data bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port c mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 201 when bit ddrcx is a logic 1, reading address $0002 reads the ptcx data latch. when bit ddrcx is a logic 0, reading address $0002 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 15-5 summarizes the operation of the port c pins. 15.5.3 port c options the adch4?dch0 bits in the adc status and control register (adscr) defines which ptcx/adcx pin is used as an adc input and overrides any control from the port i/o logic by forcing that pin as the input to the analog circuitry. see 12.8.1 adc status and control register . table 15-5. port c pin functions ptcpue bit ddrc bit ptc bit i/o pin mode accesses to ddrc accesses to ptc read/write read write 0 0 x input, hi-z (2) ddrc6?drc0 pin ptc6?tc0 (3) x 1 x output ddrc6?drc0 ptc6?tc0 ptc6?tc0 notes: 1. x = don? care 2. hi-z = high impedance 3. writing affects data register, but does not affect input. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 202 input/output (i/o) ports motorola 15.6 port d port d is an 7-bit special-function port that shares one of its pins with the sync processor and two of its pins with the ddc12ab module. note: ptd1 and ptd0 are 3.3v pins. 15.6.1 port d data register the port d data register (ptd) contains a data latch for each of the eight port d pins. ptd6?td0 ?port d data bits these read/write bits are software-programmable. data direction of each port d pin is under the control of the corresponding bit in data direction register d. reset has no effect on port d data. clamp ?sync processor clamp pulse output pin the ptd4/clamp pin is the sync processor clamp pulse output pin. when the clampe bit in the port d configuration register (pdcr) is clear, the ptd4/clamp pin is available for general-purpose i/o. see 15.6.3 port d options . address: $0003 bit 7 654321 bit 0 read: 0 ptd6 ptd5 ptd4 ptd3 ptd2 ptd1 ptd0 write: reset: unaffected by reset alternate function: clamp ddcscl ddcsda = unimplemented figure 15-12. port d data register (ptd) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port d mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 203 ddcscl, ddcsda ?ddc12ab data and clock pins the ptd3/ddcscl and ptd2/ddcsda pins are ddc12ab clock and data pins respectively. when the ddcscle and ddcdate bits in the port d configuration register (pdcr) is clear, the ptd3/ddcscl and ptd2/ddcsda pins are available for general- purpose i/o. see 15.6.3 port d options . 15.6.2 data direction register d data direction register d (ddrd) determines whether each port d pin is an input or an output. writing a logic 1 to a ddrd bit enables the output buffer for the corresponding port d pin; a logic 0 disables the output buffer. ddrd6?drd0 ?data direction register d bits these read/write bits control port d data direction. reset clears ddrd6?drd0, configuring all port d pins as inputs. 1 = corresponding port d pin configured as output 0 = corresponding port d pin configured as input note: avoid glitches on port d pins by writing to the port d data register before changing data direction register d bits from 0 to 1. figure 15-14 shows the port d i/o logic. address: $0007 bit 7 654321 bit 0 read: 0 ddrd6 ddrd5 ddrd4 ddrd3 ddrd2 ddrd1 ddrd0 write: reset: 00000000 figure 15-13. data direction register d (ddrd) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 204 input/output (i/o) ports motorola figure 15-14. port d i/o circuit when bit ddrdx is a logic 1, reading address $0003 reads the ptdx data latch. when bit ddrdx is a logic 0, reading address $0003 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 15-6 summarizes the operation of the port d pins. read ddrd ($0007) write ddrd ($0007) reset write ptd ($0003) read ptd ($0003) ptdx ddrdx ptdx internal data bus table 15-6. port d pin functions ptdpue bit ddrd bit ptd bit i/o pin mode accesses to ddrd accesses to ptd read/write read write 0 0 x input, hi-z (2) ddrd7?drd0 pin ptd7?td0 (3) x 1 x output ddrd7?drd0 ptd7?td0 ptd7?td0 notes: 1. x = don? care 2. hi-z = high impedance 3. writing affects data register, but does not affect input. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port d mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 205 15.6.3 port d options the port d configuration register (pdcr) selects the port d pins for module function or as standard i/o function. clamp ?clamp pin enable this bit is set to configure the ptd4/clamp pin for sync processor clamp pulse output. reset clears this bit. 1 = ptd4/clamp pin configured as clamp pin 0 = ptd4/clamp pin configured as standard i/o pin ddcscle ?ddc clock pin enable this bit is set to configure the ptd3/ddcscl pin for ddcscl function. reset clears this bit. 1 = ptd3/ddcscl pin configured as ddcscl pin 0 = ptd3/ddcscl pin configured as standard i/o port ddcdate ?ddc data pin enable this bit is set to configure the ptd2/ddcsda pin for ddcsda function. reset clears this bit. 1 = ptd2/ddcsda pin configured as ddcsda pin 0 = ptd2/ddcsda pin configured as standard i/o port address: $0049 bit 7 654321 bit 0 read: 0 0 0 clampe ddcscle ddcdate 00 write: reset: 00000000 = unimplemented figure 15-15. port d configuration register (pdcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 206 input/output (i/o) ports motorola 15.7 port e port e is a 3-bit special-function port that shares all of its pins with the sync processor. 15.7.1 port e data register the port e data register contains a data latch for each of the two port e pins. pte2 and pte0 ?port e data bits pte2?te0 are read/write, software programmable bits. data direction of each port e pin is under the control of the corresponding bit in data direction register e. vsynco ?vsync output the pte2/vsynco pin is the vsync output from the sync processor. when the vsyncoe is clear, the pte2/vsynco pin is available for general-purpose i/o. see 15.7.3 port e options . hsync ?hsync output the pte1/hsynco pin is the hsync output from the sync processor. when the hsyncoe is clear, the pte1/hsynco pin is available for general-purpose i/o. see 15.7.3 port e options . address: $0008 bit 7 654321 bit 0 read: 00000 pte2 pte1 pte0 write: reset: unaffected by reset alternate function: vsynco hsynco sog or tch0 = unimplemented figure 15-16. port e data register (pte) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port e mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 207 sog/tch0 ?sog output or tch0 input the pte0/sog/tch0 pin is the sog input for the sync processor or the input capture of the tim channel 0. see 15.7.3 port e options . 15.7.2 data direction register e data direction register e (ddre) determines whether each port e pin is an input or an output. writing a logic 1 to a ddre bit enables the output buffer for the corresponding port e pin; a logic 0 disables the output buffer. ddre2?dre0 ?data direction register e bits these read/write bits control port e data direction. reset clears ddre2?dre0, configuring all port e pins as inputs. 1 = corresponding port e pin configured as output 0 = corresponding port e pin configured as input note: avoid glitches on port e pins by writing to the port e data register before changing data direction register e bits from 0 to 1. figure 15-18 shows the port e i/o logic. address: $000c bit 7 654321 bit 0 read: 00000 ddre2 ddre1 ddre0 write: reset: 00000000 = unimplemented figure 15-17. data direction register e (ddre) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 208 input/output (i/o) ports motorola figure 15-18. port e i/o circuit when bit ddrex is a logic 1, reading address $0008 reads the ptex data latch. when bit ddrex is a logic 0, reading address $0008 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 15-7 summarizes the operation of the port e pins. read ddre ($0009) write ddre ($0009) reset write pte ($0008) read pte ($0008) ptex ddrex ptex internal data bus table 15-7. port e pin functions ddre bit pte bit i/o pin mode accesses to ddre accesses to pte read/write read write 0x (1) input, hi-z (2) ddre1?dre0 pin pte1?te0 (3) 1 x output ddre1?dre0] pte1?te0 pte1?te0 notes: 1. x = don? care 2. hi-z = high impedance 3. writing affects data register, but does not affect input. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port e mc68HC08BD24 ? rev. 1.0 technical data motorola input/output (i/o) ports 209 15.7.3 port e options the configuration register 0 (config0) selects the port e pins for module function or as standard i/o function. hsyncoe ?vsynco enable this bit is set to configure the pte1/hsynco pin for hsynco output function. reset clears this bit. 1 = pte1/hsynco pin configured as hsynco pin 0 = pte1/hsynco pin configured as standard i/o pin vsyncoe ?vsynco enable this bit is set to configure the pte2/vsynco pin for vsynco output function. reset clears this bit. 1 = pte2/vsynco pin configured as vsynco pin 0 = pte2/vsynco pin configured as standard i/o pin soge ?sog enable this bit is set to configure the pte0/sog/tch0 pin for sog output function. reset clears this bit. 1 = pte0/sog/tch0 pin configured as sog pin 0 = pte0/sog/tch0 pin configured as standard i/o or tch0 pin. tch0 function is configured by els0b and els0a bits in tsc0 (bits 3 and 2 in $0010). address: $001d bit 7 654321 bit 0 read: hsyncoe vsyncoe soge 00000 write: reset: 00000000 = unimplemented figure 15-19. configuration register 0 (config0) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports technical data mc68HC08BD24 ? rev. 1.0 210 input/output (i/o) ports motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola external interrupt (irq) 211 technical data ?mc68HC08BD24 section 16. external interrupt (irq) 16.1 contents 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 16.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 16.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 16.5 irq pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 16.6 irq module during break interrupts . . . . . . . . . . . . . . . . . . . 215 16.7 irq status and control register . . . . . . . . . . . . . . . . . . . . . . 215 16.2 introduction the irq (external interrupt) module provides a maskable interrupt input. 16.3 features features of the irq module include: a dedicated external interrupt pin (irq ) irq interrupt control bits hysteresis buffer programmable edge-only or edge and level interrupt sensitivity automatic interrupt acknowledge internal pullup resistor f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
external interrupt (irq) technical data mc68HC08BD24 ? rev. 1.0 212 external interrupt (irq) motorola 16.4 functional description a logic 0 applied to the external interrupt pin can latch a cpu interrupt request. figure 16-1 shows the structure of the irq module. interrupt signals on the irq pin are latched into the irq latch. an interrupt latch remains set until one of the following actions occurs: vector fetch ?a vector fetch automatically generates an interrupt acknowledge signal that clears the latch that caused the vector fetch. software clear ?software can clear an interrupt latch by writing to the appropriate acknowledge bit in the interrupt status and control register (intscr). writing a logic 1 to the ack bit clears the irq latch. reset ?a reset automatically clears the interrupt latch. the external interrupt pin is falling-edge-triggered and is software- configurable to be either falling-edge or falling-edge and low-level- triggered. the mode bit in the intscr controls the triggering sensitivity of the irq pin. when an interrupt pin is edge-triggered only, the interrupt remains set until a vector fetch, software clear, or reset occurs. when an interrupt pin is both falling-edge and low-level-triggered, the interrupt remains set until both of the following occur: vector fetch or software clear return of the interrupt pin to logic 1 the vector fetch or software clear may occur before or after the interrupt pin returns to logic 1. as long as the pin is low, the interrupt request remains pending. a reset will clear the latch and the mode control bit, thereby clearing the interrupt even if the pin stays low. when set, the imask bit in the intscr mask all external interrupt requests. a latched interrupt request is not presented to the interrupt priority logic unless the imask bit is clear. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
external interrupt (irq) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola external interrupt (irq) 213 note: the interrupt mask (i) in the condition code register (ccr) masks all interrupt requests, including external interrupt requests. figure 16-1. irq module block diagram ack imask dq ck clr irq high interrupt to mode select logic irq ff request v dd mode voltage detect synchro- nizer irqf to cpu for bil/bih instructions vector fetch decoder internal address bus reset v dd internal pullup device irq table 16-1. irq i/o register summary addr register name bit 7 654321 bit 0 $001e irq status and control register (intscr) read: 0000 irqf 0 imask mode write: ack reset: 00000000 = unimplemented f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
external interrupt (irq) technical data mc68HC08BD24 ? rev. 1.0 214 external interrupt (irq) motorola 16.5 irq pin a logic 0 on the irq pin can latch an interrupt request into the irq latch. a vector fetch, software clear, or reset clears the irq latch. if the mode bit is set, the irq pin is both falling-edge-sensitive and low- level-sensitive. with mode set, both of the following actions must occur to clear irq: vector fetch or software clear ?a vector fetch generates an interrupt acknowledge signal to clear the latch. software may generate the interrupt acknowledge signal by writing a logic 1 to the ack bit in the interrupt status and control register (intscr). the ack bit is useful in applications that poll the irq pin and require software to clear the irq latch. writing to the ack bit prior to leaving an interrupt service routine can also prevent spurious interrupts due to noise. setting ack does not affect subsequent transitions on the irq pin. a falling edge that occurs after writing to the ack bit another interrupt request. if the irq mask bit, imask, is clear, the cpu loads the program counter with the vector address at locations $fffa and $fffb. return of the irq pin to logic 1 ?as long as the irq pin is at logic 0, irq remains active. the vector fetch or software clear and the return of the irq pin to logic 1 may occur in any order. the interrupt request remains pending as long as the irq pin is at logic 0. a reset will clear the latch and the mode control bit, thereby clearing the interrupt even if the pin stays low. if the mode bit is clear, the irq pin is falling-edge-sensitive only. with mode clear, a vector fetch or software clear immediately clears the irq latch. the irqf bit in the intscr register can be used to check for pending interrupts. the irqf bit is not affected by the imask bit, which makes it useful in applications where polling is preferred. use the bih or bil instruction to read the logic level on the irq pin. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
external interrupt (irq) irq module during break interrupts mc68HC08BD24 ? rev. 1.0 technical data motorola external interrupt (irq) 215 note: when using the level-sensitive interrupt trigger, avoid false interrupts by masking interrupt requests in the interrupt routine. 16.6 irq module during break interrupts the bcfe bit in the sim break flag control register (sbfcr) enables software to clear the latch during the break state. see section 18. break module (brk) . to allow software to clear the irq latch during a break interrupt, write a logic 1 to the bcfe bit. if a latch is cleared during the break state, it remains cleared when the mcu exits the break state. to protect cpu interrupt flags during the break state, write a logic 0 to the bcfe bit. with bcfe at logic 0 (its default state), writing to the ack bit in the irq status and control register during the break state has no effect on the irq interrupt flags. 16.7 irq status and control register the irq status and control register (intscr) controls and monitors operation of the irq module. the intscr: shows the state of the irq flag clears the irq latch masks irq interrupt request controls triggering sensitivity of the irq interrupt pin f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
external interrupt (irq) technical data mc68HC08BD24 ? rev. 1.0 216 external interrupt (irq) motorola irqf ?irq flag bit this read-only status bit is high when the irq interrupt is pending. 1 = irq interrupt pending 0 = irq interrupt not pending ack ?irq interrupt request acknowledge bit writing a logic 1 to this write-only bit clears the irq latch. ack always reads as logic 0. reset clears ack. imask ?irq interrupt mask bit writing a logic 1 to this read/write bit disables irq interrupt requests. reset clears imask. 1 = irq interrupt requests disabled 0 = irq interrupt requests enabled mode ?irq edge/level select bit this read/write bit controls the triggering sensitivity of the irq pin. reset clears mode. 1 = irq interrupt requests on falling edges and low levels 0 = irq interrupt requests on falling edges only address: $001e bit 7 654321 bit 0 read: irqf 0 imask mode write: ack reset: 00000000 = unimplemented figure 16-2. irq status and control register (intscr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola computer operating properly (cop) 217 technical data ?mc68HC08BD24 section 17. computer operating properly (cop) 17.1 contents 17.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 17.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 17.4 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 17.4.1 oscxclk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 17.4.2 stop instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 17.4.3 copctl write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 17.4.4 power-on reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 17.4.5 internal reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 17.4.6 reset vector fetch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 17.4.7 copd (cop disable). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 17.4.8 coprs (cop rate select) . . . . . . . . . . . . . . . . . . . . . . . . 220 17.5 cop control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 17.6 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 17.7 monitor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 17.8 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 17.8.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 17.8.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 17.9 cop module during break mode . . . . . . . . . . . . . . . . . . . . . . 222 17.2 introduction the computer operating properly (cop) module contains a free-running counter that generates a reset if allowed to overflow. the cop module helps software recover from runaway code. prevent a cop reset by clearing the cop counter periodically. the cop module can be disabled through the copd bit in the config register. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
computer operating properly (cop) technical data mc68HC08BD24 ? rev. 1.0 218 computer operating properly (cop) motorola 17.3 functional description figure 17-1 shows the structure of the cop module. figure 17-1. cop block diagram the cop counter is a free-running 6-bit counter preceded by a 12-bit prescaler counter. if not cleared by software, the cop counter overflows and generates an asynchronous reset after 2 18 ?2 4 or 2 13 ?2 4 oscxclk cycles, depending on the state of the cop rate select bit, coprs, in configuration register 1. with a 2 18 ?2 4 oscxclk cycle overflow option, a 24mhz crystal gives a cop timeout period of 10.922ms. writing any value to location $ffff before an overflow occurs prevents a cop reset by clearing the cop counter and stages 12 through 5 of the prescaler. note: service the cop immediately after reset and before entering or after exiting stop mode to guarantee the maximum time before the first cop counter overflow. copctl write oscxclk reset vector fetch reset circuit reset status register internal reset sources 12-bit cop prescaler clear all stages 6-bit cop counter cop disable reset copctl write clear cop module copen (from sim) cop counter cop clock cop timeout stop instruction (copd from config1) cop rate sel (coprs from config1) clear stages 5?2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
computer operating properly (cop) i/o signals mc68HC08BD24 ? rev. 1.0 technical data motorola computer operating properly (cop) 219 a cop reset pulls the rst pin low for 32 oscxclk cycles and sets the cop bit in the sim reset status register (srsr). in monitor mode, the cop is disabled if the rst pin or the irq1 is held at v tst . during the break state, v tst on the rst pin disables the cop. note: place cop clearing instructions in the main program and not in an interrupt subroutine. such an interrupt subroutine could keep the cop from generating a reset even while the main program is not working properly. 17.4 i/o signals the following paragraphs describe the signals shown in figure 17-1 . 17.4.1 oscxclk oscxclk is the crystal oscillator output signal. oscxclk frequency is equal to the crystal frequency. 17.4.2 stop instruction the stop instruction clears the cop prescaler. 17.4.3 copctl write writing any value to the cop control register (copctl) (see 17.5 cop control register ) clears the cop counter and clears bits 12 through 5 of the prescaler. reading the cop control register returns the low byte of the reset vector. 17.4.4 power-on reset the power-on reset (por) circuit clears the cop prescaler 4096 oscxclk cycles after power-up. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
computer operating properly (cop) technical data mc68HC08BD24 ? rev. 1.0 220 computer operating properly (cop) motorola 17.4.5 internal reset an internal reset clears the cop prescaler and the cop counter. 17.4.6 reset vector fetch a reset vector fetch occurs when the vector address appears on the data bus. a reset vector fetch clears the cop prescaler. 17.4.7 copd (cop disable) the copd signal reflects the state of the cop disable bit (copd) in the configuration register 1 (see figure 17-2 ). 17.4.8 coprs (cop rate select) the coprs signal reflects the state of the cop rate select bit (coprs) in the configuration register 1(see figure 17-2 ). coprs ?cop rate select bit coprs selects the cop timeout period. reset clears coprs. 1 = cop timeout period = 2 13 ?2 4 oscxclk cycles 0 = cop timeout period = 2 18 ?2 4 oscxclk cycles copd ?cop disable bit copd disables the cop module. 1 = cop module disabled 0 = cop module enabled address: $001f bit 7 654321 bit 0 read: 0000 ssrec coprs stop copd write: reset: 00000000 = unimplemented figure 17-2. configuration register 1 (config1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
computer operating properly (cop) cop control register mc68HC08BD24 ? rev. 1.0 technical data motorola computer operating properly (cop) 221 17.5 cop control register the cop control register is located at address $ffff and overlaps the reset vector. writing any value to $ffff clears the cop counter and starts a new timeout period. reading location $ffff returns the low byte of the reset vector. 17.6 interrupts the cop does not generate cpu interrupt requests. 17.7 monitor mode when monitor mode is entered with v tst on the irq pin, the cop is disabled as long as v tst remains on the irq pin or the rst pin. when monitor mode is entered by having blank reset vectors and not having v tst on the irq pin, the cop is automatically disabled until a por occurs. 17.8 low-power modes the wait and stop instructions put the mcu in low power- consumption standby modes. address: $ffff bit 7 654321 bit 0 read: low byte of reset vector write: clear cop counter reset: unaffected by reset figure 17-3. cop control register (copctl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
computer operating properly (cop) technical data mc68HC08BD24 ? rev. 1.0 222 computer operating properly (cop) motorola 17.8.1 wait mode the cop remains active during wait mode. to prevent a cop reset during wait mode, periodically clear the cop counter in a cpu interrupt routine. 17.8.2 stop mode stop mode turns off the oscxclk input to the cop and clears the cop prescaler. service the cop immediately before entering or after exiting stop mode to ensure a full cop timeout period after entering or exiting stop mode. to prevent inadvertently turning off the cop with a stop instruction, a configuration option is available that disables the stop instruction. when the stop bit in the configuration register has the stop instruction is disabled, execution of a stop instruction results in an illegal opcode reset. 17.9 cop module during break mode the cop is disabled during a break interrupt when v tst is present on the rst pin. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola break module (brk) 223 technical data ?mc68HC08BD24 section 18. break module (brk) 18.1 contents 18.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 18.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 18.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 18.4.1 flag protection during break interrupts . . . . . . . . . . . . . . . 226 18.4.2 cpu during break interrupts . . . . . . . . . . . . . . . . . . . . . . . 226 18.4.3 tim during break interrupts . . . . . . . . . . . . . . . . . . . . . . . . 226 18.4.4 cop during break interrupts . . . . . . . . . . . . . . . . . . . . . . . 226 18.5 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 18.5.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 18.5.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 18.6 break module registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 18.6.1 break status and control register. . . . . . . . . . . . . . . . . . . 227 18.6.2 break address registers . . . . . . . . . . . . . . . . . . . . . . . . . . 228 18.6.3 sim break status register . . . . . . . . . . . . . . . . . . . . . . . . . 228 18.6.4 sim break flag control register . . . . . . . . . . . . . . . . . . . . 230 18.2 introduction this section describes the break module. the break module can generate a break interrupt that stops normal program flow at a defined address to enter a background program. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
break module (brk) technical data mc68HC08BD24 ? rev. 1.0 224 break module (brk) motorola 18.3 features features of the break module include: accessible input/output (i/o) registers during the break interrupt cpu-generated break interrupts software-generated break interrupts cop disabling during break interrupts 18.4 functional description when the internal address bus matches the value written in the break address registers, the break module issues a breakpoint signal to the cpu. the cpu then loads the instruction register with a software interrupt instruction (swi) after completion of the current cpu instruction. the program counter vectors to $fffc and $fffd ($fefc and $fefd in monitor mode). the following events can cause a break interrupt to occur: a cpu-generated address (the address in the program counter) matches the contents of the break address registers. software writes a logic 1 to the brka bit in the break status and control register. when a cpu-generated address matches the contents of the break address registers, the break interrupt begins after the cpu completes its current instruction. a return-from-interrupt instruction (rti) in the break routine ends the break interrupt and returns the mcu to normal operation. figure 18-1 shows the structure of the break module. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
break module (brk) functional description mc68HC08BD24 ? rev. 1.0 technical data motorola break module (brk) 225 figure 18-1. break module block diagram iab15?ab8 iab7?ab0 8-bit comparator 8-bit comparator control break address register low break address register high iab15?ab0 break table 18-1. break module i/o register summary addr. register name bit 7 654321 bit 0 $fe00 sim break status register (sbsr) read: rrrrrr sbsw r write: note reset: 00000000 $fe03 sim break flag control register (sbfcr) read: bcfe rrrrrrr write: reset: 0 $fe0c break address register high (brkh) read: bit 15 14 13 12 11 10 9 bit 8 write: reset: 00000000 $fe0d break address register low (brkl) read: bit 7 654321 bit 0 write: reset: 00000000 $fe0e break status and control register (brkscr) read: brke brka 000000 write: reset: 00000000 note: writing a logic 0 clears sbsw. = unimplemented r = reserved f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
break module (brk) technical data mc68HC08BD24 ? rev. 1.0 226 break module (brk) motorola 18.4.1 flag protection during break interrupts the bcfe bit in the sim break flag control register (sbfcr) enables software to clear status bits during the break state. 18.4.2 cpu during break interrupts the cpu starts a break interrupt by: loading the instruction register with the swi instruction loading the program counter with $fffc and $fffd ($fefc and $fefd in monitor mode) the break interrupt begins after completion of the cpu instruction in progress. if the break address register match occurs on the last cycle of a cpu instruction, the break interrupt begins immediately. 18.4.3 tim during break interrupts a break interrupt stops the timer counters. 18.4.4 cop during break interrupts the cop is disabled during a break interrupt when v tst is present on the rst pin. 18.5 low-power modes the wait and stop instructions put the mcu in low power- consumption standby modes. 18.5.1 wait mode if enabled, the break module is active in wait mode. in the break routine, the user can subtract one from the return address on the stack if sbsw is set (see section 7. system integration module (sim) ). clear the sbsw bit by writing logic 0 to it. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
break module (brk) break module registers mc68HC08BD24 ? rev. 1.0 technical data motorola break module (brk) 227 18.5.2 stop mode a break interrupt causes exit from stop mode and sets the sbsw bit in the break status register. 18.6 break module registers these registers control and monitor operation of the break module: break status and control register (brkscr) break address register high (brkh) break address register low (brkl) sim break status register (sbsr) sim break flag control register (sbfcr) 18.6.1 break status and control register the break status and control register (brkscr) contains break module enable and status bits. brke ?break enable bit this read/write bit enables breaks on break address register matches. clear brke by writing a logic 0 to bit 7. reset clears the brke bit. 1 = breaks enabled on 16-bit address match 0 = breaks disabled on 16-bit address match address: $fe0e bit 7 654321 bit 0 read: brke brka 000000 write: reset: 00000000 = unimplemented figure 18-2. break status and control register (brkscr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
break module (brk) technical data mc68HC08BD24 ? rev. 1.0 228 break module (brk) motorola brka ?break active bit this read/write status and control bit is set when a break address match occurs. writing a logic 1 to brka generates a break interrupt. clear brka by writing a logic 0 to it before exiting the break routine. reset clears the brka bit. 1 = (when read) break address match 0 = (when read) no break address match 18.6.2 break address registers the break address registers (brkh and brkl) contain the high and low bytes of the desired breakpoint address. reset clears the break address registers. 18.6.3 sim break status register the sim break status register (sbsr) contains a flag to indicate that a break caused an exit from wait mode. the flag is useful in applications requiring a return to wait mode after exiting from a break interrupt. address: $fe0c bit 7 654321 bit 0 read: bit 15 14 13 12 11 10 9 bit 8 write: reset: 00000000 figure 18-3. break address register high (brkh) address: $fe0d bit 7 654321 bit 0 read: bit 7 654321 bit 0 write: reset: 00000000 figure 18-4. break address register low (brkl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
break module (brk) break module registers mc68HC08BD24 ? rev. 1.0 technical data motorola break module (brk) 229 sbsw ?sim break stop/wait bit this status bit is useful in applications requiring a return to wait or stop mode after exiting from a break interrupt. clear sbsw by writing a logic 0 to it. reset clears sbsw. 1 = stop mode or wait mode was exited by break interrupt 0 = stop mode or wait mode was not exited by break interrupt sbsw can be read within the break interrupt routine. the user can modify the return address on the stack by subtracting one from it. the following code is an example. address: $fe00 bit 7 654321 bit 0 read: rrrrrr sbsw r write: note reset: 00000000 note: writing a logic 0 clears sbsw. r = reserved figure 18-5. sim break status register (sbsr) ; ; ; this code works if the h register has been pushed onto the stack in the break service routine software. this code should be executed at the end of the break service routine software. hibyte equ 5 lobyte equ 6 ; if not sbsw, do rti brclr sbsw,sbsr, return ; ; see if wait mode or stop mode was exited by break. tst lobyte,sp ;if returnlo is not zero, bne dolo ;then just decrement low byte. dec hibyte,sp ;else deal with high byte, too. dolo dec lobyte,sp ;point to wait/stop opcode. return pulh rti ;restore h register. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
break module (brk) technical data mc68HC08BD24 ? rev. 1.0 230 break module (brk) motorola 18.6.4 sim break flag control register the sim break flag control register (sbfcr) contains a bit that enables software to clear status bits while the mcu is in a break state. bcfe ?break clear flag enable bit this read/write bit enables software to clear status bits by accessing status registers while the mcu is in a break state. to clear status bits during the break state, the bcfe bit must be set. 1 = status bits clearable during break 0 = status bits not clearable during break address: $fe03 bit 7 654321 bit 0 read: bcfe rrrrrrr write: reset: 0 r = reserved figure 18-6. sim break flag control register (sbfcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola electrical specifications 231 technical data ?mc68HC08BD24 section 19. electrical specifications 19.1 contents 19.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 19.3 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . 232 19.4 functional operating range. . . . . . . . . . . . . . . . . . . . . . . . . . 233 19.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 19.6 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 234 19.7 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 19.8 oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 19.9 adc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 19.10 timer interface module characteristics . . . . . . . . . . . . . . . . . 237 19.11 sync processor timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 19.12 ddc12ab timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 19.12.1 ddc12ab interface input signal timing . . . . . . . . . . . . . . 238 19.12.2 ddc12ab interface output signal timing . . . . . . . . . . . . . 238 19.2 introduction this section contains electrical and timing specifications. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical speci?ations technical data mc68HC08BD24 ? rev. 1.0 232 electrical specifications motorola 19.3 absolute maximum ratings maximum ratings are the extreme limits to which the mcu can be exposed without permanently damaging it. note: this device is not guaranteed to operate properly at the maximum ratings. refer to 19.6 dc electrical characteristics for guaranteed operating conditions. note: this device contains circuitry to protect the inputs against damage due to high static voltages or electric fields; however, it is advised that normal precautions be taken to avoid application of any voltage higher than maximum-rated voltages to this high-impedance circuit. for proper operation, it is recommended that v in and v out be constrained to the range v ss (v in or v out ) v dd . reliability of operation is enhanced if unused inputs are connected to an appropriate logic voltage level (for example, either v ss or v dd .) characteristic symbol value unit supply voltage v dd 0.3 to +5.5 v input voltage v in v ss 0.3 to v dd +0.3 v maximum current per pin excluding v dd and v ss i 25 ma storage temperature t stg 55 to +150 c maximum current out of v ss i mvss 100 ma maximum current into v dd i mvdd 100 ma note: 1. voltages referenced to v ss . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications functional operating range mc68HC08BD24 ? rev. 1.0 technical data motorola electrical specifications 233 19.4 functional operating range 19.5 thermal characteristics characteristic symbol value unit operating temperature range t a 0 to 85 c operating voltage range v dd 4.5 to 5.5 v characteristic symbol value unit thermal resistance qfp (44 pins) sdip (42 pins) q ja 95 60 c/w i/o pin power dissipation p i/o user determined w power dissipation (1) p d p d = (i dd v dd ) + p i/o = k/(t j + 273 c) w constant (2) k p d (t a + 273 c ) + p d 2 q ja w/ c average junction temperature t j t a + (p d q ja ) c maximum junction temperature t jm 100 c notes: 1. power dissipation is a function of temperature. 2. k is a constant unique to the device. k can be determined for a known t a and measured p d. with this value of k, p d and t j can be determined for any value of t a . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical speci?ations technical data mc68HC08BD24 ? rev. 1.0 234 electrical specifications motorola 19.6 dc electrical characteristics characteristic symbol min typ (2) max unit output high voltage (i load = 2.0ma) all i/o pins (except ptd0, ptd1, osc2) v oh v dd ?0.8 v ptd0, ptd1, osc2 v dd ?0.8 output low voltage (i load = 1.6ma) all i/o pins (except ptd0, ptd1, osc2) ptd0, ptd1, osc2 v ol 0.4 0.4 v input high voltage all ports (except ptd0, ptd1), irq , rst vsync, hsync v ih 0.7 v dd 2.0 v dd v dd v ptd0, ptd1, osc1 0.7 v dd v dd input low voltage all ports (except ptd0, ptd1), irq , rst vsync, hsync v il v ss v ss 0.2 v dd 0.8 v ptd0, ptd1, osc1 v ss 0.2 v dd v dd supply current run (3) wait (4) stop (5) 0 c to 85 c i dd 8 4 2 12 8 5 ma ma ma i/o ports hi-z leakage current i il 10 m a input current i in 1 m a capacitance ports (as input or output) c out c in 12 8 pf por rearm voltage (6) v por 0 100 mv por rise time ramp rate (7) r por 0.035 v/ms monitor mode entry voltage v tst v dd + 2.5 8 v pull-up resistor rst , irq r pu 20 45 65 k w low-voltage inhibit, trip falling voltage v tripf 3.4 3.6 3.8 v low-voltage inhibit, trip rising voltage v tripr 3.6 3.8 4.0 v low-voltage inhibit reset/recover hysteresis v hys 200 mv ram data retention voltage v rdr 2v 2 3 -- - 2 3 -- - 2 3 -- - 2 3 -- - f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications control timing mc68HC08BD24 ? rev. 1.0 technical data motorola electrical specifications 235 19.7 control timing 19.8 oscillator characteristics notes: 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted. 2. typical values reflect average measurements at midpoint of voltage range, 25 c only. 3. run (operating) i dd measured using external square wave clock source. all inputs 0.2 v from rail. no dc loads. less than 100 pf on all outputs. c l = 15 pf on osc2. all ports configured as inputs. osc2 capacitance linearly affects run i dd . measured with all modules enabled. 4. wait i dd measured using external square wave clock source (f oscxclk = 24mhz); all inputs 0.2 v from rail; no dc loads; less than 100 pf on all outputs. c l = 15pf on osc2; all ports configured as inputs; osc2 capacitance linearly affects wait i dd . 5. stop i dd measured with osc1 grounded; no port pins sourcing current. 6. maximum is highest voltage that por is guaranteed. 7. if minimum v dd is not reached before the internal por reset is released, rst must be driven low externally until minimum v dd is reached. characteristic symbol min max unit internal operating frequency (2) f op 6 mhz rst input pulse width low (3) t irl 50 ns notes: 1. v dd = 5.0 vdc 10%, v ss = 0 vdc; timing shown with respect to 20% v dd and 70% v dd , unless otherwise noted. 2. some modules may require a minimum frequency greater than dc for proper operation; see appropriate table for this information. 3. minimum pulse width reset is guaranteed to be recognized. it is possible for a smaller pulse width to cause a reset. characteristic symbol min typ max unit crystal frequency (1) f oscxclk 24 mhz external clock reference frequency (1), (2) f oscxclk dc 24 mhz crystal load capacitance (3) c l ?5 pf crystal fixed capacitance (3) c 1 ? c l crystal tuning capacitance (3) c 2 ? c l feedback bias resistor r b ?0 m w series resistor (3), (4) r s notes: 1. the sync processor module is designed to function at f oscxclk = 24mhz. the values given here are oscillator specifications. 2. no more than 10% duty cycle deviation from 50% 3. consult crystal vendor data sheet 4. not required for high frequency crystals characteristic symbol min typ (2) max unit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical speci?ations technical data mc68HC08BD24 ? rev. 1.0 236 electrical specifications motorola 19.9 adc characteristics characteristic (1) symbol min max unit comments supply voltage v ddad 4.5 (v dd min) 5.5 (v dd max) v input voltages v adin 0 v dd v resolution b ad 8 8 bits absolute accuracy (v ss = 0 v, v dd = 5 v 10%) a ad 2 lsb includes quantization adc internal clock f adic 0.375 6 mhz t aic = 1/f adic , tested only at 1.5 mhz conversion range r ad v ss v dd v power-up time t adpu 16 t aic cycles conversion time t adc 12 13 t aic cycles sample time (2) t ads 4 t aic cycles zero input reading (3) z adi 00 02 hex full-scale reading (3) f adi fd ff hex input capacitance c adi 8 pf not tested input leakage (4) port c 1 m a notes: 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted. 2. source impedances greater than 10 k w adversely affect internal rc charging time during input sampling. 3. zero-input/full-scale reading requires sufficient decoupling measures for accurate conversions. 4. the external system error caused by input leakage current is approximately equal to the product of r source and input current. 2 3 ------ 2 3 ------ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications timer interface module characteristics mc68HC08BD24 ? rev. 1.0 technical data motorola electrical specifications 237 figure 19-1. adc input voltage vs. step readings 19.10 timer interface module characteristics 19.11 sync processor timing characteristic symbol min max unit input capture pulse width t tih, t til 125 ns input clock pulse width t tch, t tcl (1/f op ) + 5 ns characteristic symbol min max unit vsync input sync pulse t vi.sp 8 2048 m s hsync input sync pulse t hi.sp 0.1 6 m s vsync to vsynco delay (8pf loading) t vvd 30 40 m s hsync to hsynco delay (8pf loading) t hhd 30 40 m s notes: 1. v dd = 5.0 vdc 10%, v ss = 0 vdc; timing shown with respect to 20% v dd and 70% v dd , unless otherwise noted. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5 steps input voltage, adin offset is typically 22mv v dd = 5v @ 25 c, adc clock = 1.5mhz f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical speci?ations technical data mc68HC08BD24 ? rev. 1.0 238 electrical specifications motorola 19.12 ddc12ab timing 19.12.1 ddc12ab interface input signal timing 19.12.2 ddc12ab interface output signal timing characteristic symbol min max unit start condition hold time t hd.sta 2 t cyc clock low period t low 4 t cyc clock high period t high 4 t cyc data set-up time t su.dat 250 ns data hold time t hd.dat 0ns start condition set-up time (for repeated start condition only) t su.sta 2 t cyc stop condition set-up time t su.sto 2 t cyc notes: 1. v dd = 5.0 vdc 10%, v ss = 0 vdc; timing shown with respect to 20% v dd and 70% v dd , unless otherwise noted. characteristic symbol min max unit sda/scl rise time (2) t r ? m s sda/scl fall time t f 300 ns data set-up time t su.dat t low ?s data hold time t hd.dat 0ns notes: 1. v dd = 5.0 vdc 10%, v ss = 0 vdc; timing shown with respect to 20% v dd and 70% v dd , unless otherwise noted. 2. with 200pf loading on the sda/scl pins. t hd.sta t low t high t su.dat t hd.dat t su.sto sda scl t su.sta f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC08BD24 ? rev. 1.0 technical data motorola mechanical specifications 239 technical data ?mc68HC08BD24 section 20. mechanical specifications 20.1 contents 20.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 20.3 44-pin plastic quad flat pack (qfp) . . . . . . . . . . . . . . . . . . . 240 20.4 42-pin shrink dual in-line package (sdip) . . . . . . . . . . . . . . 241 20.2 introduction this section gives the dimensions for: 44-pin plastic quad flat pack (case 824e-02) 42-pin shrink dual in-line package (case 858-01) the following figures show the latest package drawings at the time of this publication. to make sure that you have the latest package specifications, contact one of the following: local motorola sales office world wide web at http://www.motorola.com/semiconductors/ follow the world wide web on-line instructions to retrieve the current mechanical specifications. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical speci?ations technical data mc68HC08BD24 ? rev. 1.0 240 mechanical specifications motorola 20.3 44-pin plastic quad flat pack (qfp) figure 20-1. 44-pin qfp (case 824e) -t- m y e w c -h- datum plane view p 0.01 (0.004) 44 1 34 33 11 12 22 23 view y -n- -l- a s l-m m 0.20 (0.008) n s h s l-m m 0.20 (0.008) n s t 0.05 (0.002) l-m s b v -m- g 40x pin 1 ident s l-m m 0.20 (0.008) n s h 0.05 (0.002) n s l-m m 0.20 (0.008) n s t s l-m m 0.20 (0.008) n s t f b1 section j1-j1 j d base metal plating 44 pl -l-, -m-, -n- j1 j1 g view y 3 pl notes: 1. dimensioning and tolerancing per ansi y14.5m, 1982. 2. controlling dimension: millimeter. 3. datum plane -h- is located at bottom of lead and is coincident with the lead where the lead exits the plastic body at the bottom of the parting line. 4. datums -l-, -m- and -n- to be determined at datum plane -h-. 5. dimensions s and v to be determined at seating plane -t-. 6. dimensions a and b do not include mold protrusion. allowable protrusion is 0.25 (0.010) per side. dimensions a and b do include mold mismatch and are determined at datum plane -h-. 7. dimension d does not include dambar protrusion. dambar protrusion shall not cause the d dimension to exceed 0.530 (0.021). q1 -h- datum plane r2 r k a1 c1 view p dim min max min max inches millimeters a 9.90 10.10 0.390 0.398 b 9.90 10.10 0.390 0.398 c 2.00 2.21 0.079 0.087 d 0.30 0.45 0.0118 0.0177 e 2.00 2.10 0.079 0.083 f 0.30 0.40 0.012 0.016 g 0.80 bsc 0.031 bsc j 0.13 0.23 0.005 0.009 k 0.65 0.95 0.026 0.037 m 5 10 5 10 s 12.95 13.45 0.510 0.530 v 12.95 13.45 0.510 0.530 w 0.000 0.210 0.000 0.008 y 5 10 5 10 a1 0.450 ref 0.170 0.018 ref 0.007 b1 c1 1.600 ref 0.063 ref r1 r2 5 10 5 10 1 2 0.130 0.005 0.130 0.300 0.005 0.012 0.130 0.300 0.005 0.012 q q 0 7 0 7 r1 r q2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical specifications 42-pin shrink dual in-line package (sdip) mc68HC08BD24 ? rev. 1.0 technical data motorola mechanical specifications 241 20.4 42-pin shrink dual in-line package (sdip) figure 20-2. 42-pin sdip (case 858) ? 42 22 121 ? seating plane ? s a m 0.25 (0.010) t s b m 0.25 (0.010) t l h m j 42 pl d 42 pl f g n k c notes: 1. dimensioning and tolerancing per ansi y14.5m, 1982. 2. controlling dimension: inch. 3. dimension l to center of lead when formed parallel. 4. dimensions a and b do not include mold flash. maximum mold flash 0.25 (0.010). dim min max min max millimeters inches a 1.435 1.465 36.45 37.21 b 0.540 0.560 13.72 14.22 c 0.155 0.200 3.94 5.08 d 0.014 0.022 0.36 0.56 f 0.032 0.046 0.81 1.17 g 0.070 bsc 1.778 bsc h 0.300 bsc 7.62 bsc j 0.008 0.015 0.20 0.38 k 0.115 0.135 2.92 3.43 l 0.600 bsc 15.24 bsc m 0 15 0 15 n 0.020 0.040 0.51 1.02 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical speci?ations technical data mc68HC08BD24 ? rev. 1.0 242 mechanical specifications motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, represen tation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any produc t or circuit, and specically disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data s heets and/or specications can and do vary in different applications and actual performance may vary over time. all operating parameters, including "typicals" must be validated for ea ch customer application by customer's technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, inte nded, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other applic ation in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or u nauthorized application, buyer shall indemnify and hold motorola and its ofcers, employees, subsidiaries, af?iates, and distributors harmless against all claims, costs, damages , and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola and are registered trademarks of motorola, inc. motorola, inc. is an equal opportu nity/afrmative action employer. how to reach us: usa/europe/locations not listed: motorola literature distribution; p.o. box 5405, denver, colorado 80217. 1-303-675-2140 or 1-800-441-2447 japan: motorola japan ltd.; sps, technical information center, 3-20-1, minami-azabu, minato-ku, tokyo 106-8573 japan. 81-3-3440-3569 asia/pacific: motorola semiconductors h.k. ltd.; silicon harbour center, 2 dai king street, tai po industrial estate, tai po, n.t., hong kong . 852-26668334 technical information center: 1-800-521-6274 home page: http://www.motorola.com/semiconductors/ ?motorola, inc., 2000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .


▲Up To Search▲   

 
Price & Availability of 68HC08BD24

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X